Skip to content

Instantly share code, notes, and snippets.

@matsuu
Last active October 21, 2015 17:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matsuu/b8aff22d3b3698c3eb1b to your computer and use it in GitHub Desktop.
Save matsuu/b8aff22d3b3698c3eb1b to your computer and use it in GitHub Desktop.
Dockerfile for Consul
#
# build
#
# # docker build -t consul:latest .
#
# bootstrap server
#
# # docker run -d consul -server -bootstrap
# # docker inspect (container_id)
#
# servers
#
# # docker run -d consul -server -join=(server address)
# # docker run -d consul -server -join=(server address)
# # docker run -d consul -server -join=(server address)
#
# clients
#
# # docker run -d consul -join=(server address)
# # docker run -d consul -join=(server address)
# # docker run -d consul -join=(server address)
#
FROM ubuntu
RUN apt-get update
RUN apt-get install -y curl unzip
RUN curl -O -L 'https://dl.bintray.com/mitchellh/consul/0.2.0_linux_amd64.zip' && \
unzip ./0.2.0_linux_amd64.zip && \
mv ./consul /usr/bin/ && \
mkdir -p /opt/consul/data && \
mkdir -p /opt/consul/etc && \
rm 0.2.0_linux_amd64.zip
EXPOSE 8300 8301 8302
VOLUME /opt/consul
#CMD ["/usr/bin/consul", "agent", "-data-dir=/opt/consul/data", "-config-dir=/opt/consul/etc", "-ui-dir=/opt/consul/ui", "-server", "-bootstrap"]
#CMD ["-server", "-bootstrap"]
ENTRYPOINT ["/usr/bin/consul", "agent", "-data-dir=/opt/consul/data", "-config-dir=/opt/consul/etc", "-ui-dir=/opt/consul/ui"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment