-
-
Save funkytaco/c8ff4474c3b5c019c5d0 to your computer and use it in GitHub Desktop.
Dockerfile for Consul
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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