Skip to content

Instantly share code, notes, and snippets.

@avi202020
Forked from erangaeb/Dockerfile
Created November 18, 2022 03:56
Show Gist options
  • Select an option

  • Save avi202020/0d58f5b20fb1bb69287c73052ceb27fe to your computer and use it in GitHub Desktop.

Select an option

Save avi202020/0d58f5b20fb1bb69287c73052ceb27fe to your computer and use it in GitHub Desktop.
dockerize consul backend
# base image
FROM alpine:3.14
# set consul version
ENV CONSUL_VERSION 1.10.2
# create a new directory
RUN mkdir /consul
# download dependencies
RUN apk --no-cache add \
bash \
ca-certificates \
wget \
curl
# download and set up consul
RUN wget --quiet --output-document=/tmp/consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip && \
unzip /tmp/consul.zip -d /consul && \
rm -f /tmp/consul.zip && \
chmod +x /consul/consul
# update PATH
ENV PATH="PATH=$PATH:$PWD/consul"
# add the config file
COPY ./config/consul-config.json /consul/config/config.json
# expose ports
EXPOSE 8300 8400 8500 8600
# run consul
ENTRYPOINT ["consul"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment