Docker consul container (with built-in glibc)
2.8K
Docker consul container is built from stackfeed/alpine:glibc. The layout of the container is originally copied from gliderlabs/consul.
Since sometimes you might desire to access Docker CLI from inside consul container, being glibc compatible stackfeed/consul containers allow you to do so. Note that you need to pass the following volumes:
-v /usr/bin/docker:/usr/bin/docker
-v /var/run/docker.sock:/var/run/docker.sock
Three are three variants available stackfeed/consul, stackfeed/consul:agent and stackfeed/consul:server, the former two are derived from the first container add their spcific configuration. When agent or server container is started the consul agent is invoked directly with the corresponding options. However the base stackfeed/consul has no specific invocation method and will just prompt with bash.
| Name | Description |
|---|---|
| CONSUL_ALLOW_PRIVILEGED_PORTS | Set this variable (can be set to "") to run setcap to allow consul to bind to privileged ports (since container executes as unprivileged user). |
Well, this is approximately how you would start a 3 node cluster on different machines:
docker run -d --name=consul-server --restart=always \
-p 8600:8600 -p 8600:8600/udp \
-p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302 -p 8302:8302/udp \
-p 8400:8400 -p 8500:8500 \
-v /consul:/data \
--log-opt='max-size=25m' --log-opt='max-file=5' \
stackfeed/consul:0.7-server \
-advertise 192.168.11.11 -bootstrap-expect 3
docker run -d --name=consul-server --restart=always \
-p 8600:8600 -p 8600:8600/udp \
-p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302 -p 8302:8302/udp \
-p 8400:8400 -p 8500:8500 \
-v /consul:/data \
--log-opt='max-size=25m' --log-opt='max-file=5' \
stackfeed/consul:0.7-server \
-advertise 192.168.11.12 -join 192.168.11.11
docker run -d --name=consul-server --restart=always \
-p 8600:8600 -p 8600:8600/udp \
-p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302 -p 8302:8302/udp \
-p 8400:8400 -p 8500:8500 \
-v /consul:/data \
--log-opt='max-size=25m' --log-opt='max-file=5' \
stackfeed/consul:0.7-server \
-advertise 192.168.11.13 -join 192.168.11.11
It's worth saying that for actual details on consul and its usage you should refer to consul docs.
Content type
Image
Digest
Size
16.6 MB
Last updated
over 9 years ago
docker pull stackfeed/consul