├── 0.5 ├── consul-agent │ ├── Dockerfile │ ├── Makefile │ └── config │ │ └── agent.json ├── consul-server │ ├── Dockerfile │ ├── Makefile │ └── config │ │ └── server.json └── consul │ ├── Dockerfile │ └── Makefile ├── 0.6 ├── consul-agent │ ├── Dockerfile │ ├── Makefile │ └── config │ │ └── agent.json ├── consul-server │ ├── Dockerfile │ ├── Makefile │ └── config │ │ └── server.json └── consul │ ├── Dockerfile │ ├── Makefile │ └── update_version.sh ├── 0.7 ├── consul-agent │ ├── Dockerfile │ ├── Makefile │ └── config │ │ └── agent.json ├── consul-server │ ├── Dockerfile │ ├── Makefile │ └── config │ │ └── server.json └── consul │ ├── Dockerfile │ ├── Makefile │ └── update_version.sh ├── LICENSE ├── Makefile ├── README.md └── SPONSORS /0.5/consul-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gliderlabs/consul:0.5 2 | ADD ./config /config/ 3 | EXPOSE 8300 8301 8301/udp 8302 8302/udp 8400 8500 8600 8600/udp 4 | ENV DNS_RESOLVES consul 5 | ENV DNS_PORT 8600 6 | ENTRYPOINT ["/bin/consul", "agent", "-config-dir=/config"] 7 | -------------------------------------------------------------------------------- /0.5/consul-agent/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul-agent . 4 | -------------------------------------------------------------------------------- /0.5/consul-agent/config/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "client_addr": "0.0.0.0", 3 | "data_dir": "/data", 4 | "leave_on_terminate": true, 5 | "dns_config": { 6 | "allow_stale": true, 7 | "max_stale": "1s" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /0.5/consul-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gliderlabs/consul-agent:0.5 2 | ADD ./config /config/ 3 | ADD https://dl.bintray.com/mitchellh/consul/0.5.2_web_ui.zip /tmp/webui.zip 4 | RUN cd /tmp && unzip webui.zip && mv dist /ui && rm webui.zip 5 | ENTRYPOINT ["/bin/consul", "agent", "-server", "-config-dir=/config"] 6 | -------------------------------------------------------------------------------- /0.5/consul-server/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul-server . 4 | -------------------------------------------------------------------------------- /0.5/consul-server/config/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "ui_dir": "/ui", 3 | "server": true, 4 | "dns_config": { 5 | "allow_stale": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /0.5/consul/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.2 2 | 3 | ENV CONSUL_VERSION 0.5.2 4 | ENV CONSUL_SHA256 171cf4074bfca3b1e46112105738985783f19c47f4408377241b868affa9d445 5 | 6 | RUN apk --update add curl ca-certificates && \ 7 | curl -Ls https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk > /tmp/glibc-2.21-r2.apk && \ 8 | apk add --allow-untrusted /tmp/glibc-2.21-r2.apk && \ 9 | rm -rf /tmp/glibc-2.21-r2.apk /var/cache/apk/* 10 | ADD https://dl.bintray.com/mitchellh/consul/${CONSUL_VERSION}_linux_amd64.zip /tmp/consul.zip 11 | RUN echo "${CONSUL_SHA256} /tmp/consul.zip" > /tmp/consul.sha256 \ 12 | && sha256sum -c /tmp/consul.sha256 \ 13 | && cd /bin \ 14 | && unzip /tmp/consul.zip \ 15 | && chmod +x /bin/consul \ 16 | && rm /tmp/consul.zip 17 | 18 | ENTRYPOINT ["/bin/consul"] 19 | -------------------------------------------------------------------------------- /0.5/consul/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul . 4 | -------------------------------------------------------------------------------- /0.6/consul-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gliderlabs/consul:0.6 2 | ADD ./config /config/ 3 | EXPOSE 8300 8301 8301/udp 8302 8302/udp 8400 8500 8600 8600/udp 4 | ENV DNS_RESOLVES consul 5 | ENV DNS_PORT 8600 6 | ENTRYPOINT ["/bin/consul", "agent", "-config-dir=/config"] 7 | -------------------------------------------------------------------------------- /0.6/consul-agent/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul-agent:$(VERSION) . 4 | -------------------------------------------------------------------------------- /0.6/consul-agent/config/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "client_addr": "0.0.0.0", 3 | "data_dir": "/data", 4 | "leave_on_terminate": true, 5 | "dns_config": { 6 | "allow_stale": true, 7 | "max_stale": "1s" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /0.6/consul-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gliderlabs/consul-agent:0.6 2 | ADD ./config /config/ 3 | ENTRYPOINT ["/bin/consul", "agent", "-server", "-config-dir=/config"] 4 | -------------------------------------------------------------------------------- /0.6/consul-server/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul-server:$(VERSION) . 4 | -------------------------------------------------------------------------------- /0.6/consul-server/config/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "ui": true, 3 | "dns_config": { 4 | "allow_stale": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /0.6/consul/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | 3 | ENV CONSUL_VERSION 0.6.4 4 | ENV CONSUL_SHA256 abdf0e1856292468e2c9971420d73b805e93888e006c76324ae39416edcf0627 5 | 6 | RUN apk --no-cache add curl ca-certificates \ 7 | && curl -sSL https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip -o /tmp/consul.zip \ 8 | && echo "${CONSUL_SHA256} /tmp/consul.zip" > /tmp/consul.sha256 \ 9 | && sha256sum -c /tmp/consul.sha256 \ 10 | && cd /bin \ 11 | && unzip /tmp/consul.zip \ 12 | && chmod +x /bin/consul \ 13 | && rm /tmp/consul.zip 14 | 15 | ENTRYPOINT ["/bin/consul"] 16 | -------------------------------------------------------------------------------- /0.6/consul/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul:$(VERSION) . 4 | -------------------------------------------------------------------------------- /0.6/consul/update_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | [[ "$TRACE" ]] && set -x || : 5 | 6 | debug() { 7 | [[ "$DEBUG" ]] && echo "-----> $*" 1>&2 8 | } 9 | 10 | consul_version() { 11 | sed -n "s/ENV CONSUL_VERSION //p" Dockerfile 12 | } 13 | 14 | next_version() { 15 | debug "new version will be calculated ..." 16 | local oldVersion=$(consul_version) 17 | debug "oldVersion: $oldVersion" 18 | echo ${oldVersion%.*}.$((${oldVersion##*.} + 1)) 19 | } 20 | 21 | update_dockerfile() { 22 | declare ver=${1:? required} 23 | 24 | local sha=$(curl -Ls https://releases.hashicorp.com/consul/${ver}/consul_${ver}_SHA256SUMS | sed -n "s/ .*linux_amd64.*//p") 25 | debug "sha=$sha" 26 | 27 | sed -i "s/\(ENV CONSUL_VERSION\) .*/\1 $newVersion/;s/\(ENV CONSUL_SHA256\) .*/\1 $sha/" Dockerfile 28 | } 29 | 30 | main() { 31 | declare desc="Updates Dockerfile url/sha for the provided version, or calculates next patch version if called without params" 32 | declare newVersion=${1:-$(next_version)} 33 | 34 | debug "newVersion=$newVersion" 35 | update_dockerfile $newVersion 36 | git diff 37 | echo "=====> Now you can run: git commit -am 'Upgrade Consul to $newVersion'" 38 | } 39 | 40 | [[ "$0" == "$BASH_SOURCE" ]] && main "$@" || : 41 | -------------------------------------------------------------------------------- /0.7/consul-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gliderlabs/consul:0.7 2 | ADD ./config /config/ 3 | EXPOSE 8300 8301 8301/udp 8302 8302/udp 8400 8500 8600 8600/udp 4 | ENV DNS_RESOLVES consul 5 | ENV DNS_PORT 8600 6 | ENTRYPOINT ["/bin/consul", "agent", "-config-dir=/config"] 7 | -------------------------------------------------------------------------------- /0.7/consul-agent/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul-agent:$(VERSION) . 4 | -------------------------------------------------------------------------------- /0.7/consul-agent/config/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "client_addr": "0.0.0.0", 3 | "data_dir": "/data", 4 | "leave_on_terminate": true, 5 | "dns_config": { 6 | "allow_stale": true, 7 | "max_stale": "1s" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /0.7/consul-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gliderlabs/consul-agent:0.7 2 | ADD ./config /config/ 3 | ENTRYPOINT ["/bin/consul", "agent", "-server", "-config-dir=/config"] 4 | -------------------------------------------------------------------------------- /0.7/consul-server/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul-server:$(VERSION) . 4 | -------------------------------------------------------------------------------- /0.7/consul-server/config/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "ui": true, 3 | "dns_config": { 4 | "allow_stale": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /0.7/consul/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | 3 | ENV CONSUL_VERSION 0.7.0 4 | ENV CONSUL_SHA256 b350591af10d7d23514ebaa0565638539900cdb3aaa048f077217c4c46653dd8 5 | 6 | RUN apk --no-cache add curl ca-certificates \ 7 | && curl -sSL https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip -o /tmp/consul.zip \ 8 | && echo "${CONSUL_SHA256} /tmp/consul.zip" > /tmp/consul.sha256 \ 9 | && sha256sum -c /tmp/consul.sha256 \ 10 | && cd /bin \ 11 | && unzip /tmp/consul.zip \ 12 | && chmod +x /bin/consul \ 13 | && rm /tmp/consul.zip 14 | 15 | ENTRYPOINT ["/bin/consul"] 16 | -------------------------------------------------------------------------------- /0.7/consul/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: 3 | docker build -t gliderlabs/consul:$(VERSION) . 4 | -------------------------------------------------------------------------------- /0.7/consul/update_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | [[ "$TRACE" ]] && set -x || : 5 | 6 | debug() { 7 | [[ "$DEBUG" ]] && echo "-----> $*" 1>&2 8 | } 9 | 10 | consul_version() { 11 | sed -n "s/ENV CONSUL_VERSION //p" Dockerfile 12 | } 13 | 14 | next_version() { 15 | debug "new version will be calculated ..." 16 | local oldVersion=$(consul_version) 17 | debug "oldVersion: $oldVersion" 18 | echo ${oldVersion%.*}.$((${oldVersion##*.} + 1)) 19 | } 20 | 21 | update_dockerfile() { 22 | declare ver=${1:? required} 23 | 24 | local sha=$(curl -Ls https://releases.hashicorp.com/consul/${ver}/consul_${ver}_SHA256SUMS | sed -n "s/ .*linux_amd64.*//p") 25 | debug "sha=$sha" 26 | 27 | sed -i "s/\(ENV CONSUL_VERSION\) .*/\1 $newVersion/;s/\(ENV CONSUL_SHA256\) .*/\1 $sha/" Dockerfile 28 | } 29 | 30 | main() { 31 | declare desc="Updates Dockerfile url/sha for the provided version, or calculates next patch version if called without params" 32 | declare newVersion=${1:-$(next_version)} 33 | 34 | debug "newVersion=$newVersion" 35 | update_dockerfile $newVersion 36 | git diff 37 | echo "=====> Now you can run: git commit -am 'Upgrade Consul to $newVersion'" 38 | } 39 | 40 | [[ "$0" == "$BASH_SOURCE" ]] && main "$@" || : 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Glider Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION=0.7 2 | 3 | build: 4 | VERSION=$(VERSION) make -C $(VERSION)/consul 5 | VERSION=$(VERSION) make -C $(VERSION)/consul-agent 6 | VERSION=$(VERSION) make -C $(VERSION)/consul-server 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Consul in Docker 2 | 3 | Looking for what used to be `progrium/consul`? Look in the `legacy` branch. 4 | 5 | ## License 6 | 7 | MIT 8 | 9 | 10 | -------------------------------------------------------------------------------- /SPONSORS: -------------------------------------------------------------------------------- 1 | DigitalOcean http://digitalocean.com 2 | HashiCorp http://hashicorp.com 3 | --------------------------------------------------------------------------------