G’day,
I’ve the need to put the IP address for a container in a command in
docker-compose. Like so:
etcd:
image: quay.io/coreos/etcd:v2.3.0-alpha.1
command: -advertise-client-urls=http://172.17.0.6:2379
-listen-client-urls=http://0.0.0.0:2379
# command: -advertise-client-urls=http://$${ETCD_PORT_2379_TCP_ADDR}:2379
-listen-client-urls=http://0.0.0.0:2379
# command: -advertise-client-urls=http://etcd:2379 -listen-client-urls=
http://0.0.0.0:2379
ports:
- "2379:2379"
volumes:
- "/usr/share/ca-certificates/:/etc/ssl/certs"
I’d like to use something like the commented out versions, but they don’t
work.
Using 0.0.0.0 in -advertise-client-urls doesn’t allow to reach etcd from
other containers.
Hardcoding the IP address works, but is not a good solution.
Any suggestion?
Thanks,