Skip to content

Instantly share code, notes, and snippets.

@erangaeb
Created November 12, 2022 10:02
Show Gist options
  • Save erangaeb/d4475a485d4f7bcfb6b3d5371eef6ef0 to your computer and use it in GitHub Desktop.
Save erangaeb/d4475a485d4f7bcfb6b3d5371eef6ef0 to your computer and use it in GitHub Desktop.
dockerize vault with consul backend config
# base image
FROM alpine:3.14
# set vault version
ENV VAULT_VERSION 1.8.2
# create a new directory
RUN mkdir /vault
# download dependencies
RUN apk --no-cache add \
bash \
ca-certificates \
wget \
curl
# download and set up vault
RUN wget --quiet --output-document=/tmp/vault.zip https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip && \
unzip /tmp/vault.zip -d /vault && \
rm -f /tmp/vault.zip && \
chmod +x /vault
# update PATH
ENV PATH="PATH=$PATH:$PWD/vault"
# add the config file
COPY ./config/vault-consul-backend-config.json /vault/config/vault-config.json
# expose port 8200
EXPOSE 8200
# run vault
ENTRYPOINT ["vault"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment