I’m toying with the new network feature from docker 1.9 and I’m wondering how /etc/hosts is managed now. Here’s my use case :
I create a bridge network with
docker network create --driver bridge my_bridge
And add a container in it specifying its hostname
docker run -d --net my_bridge -h container_A -t bla:new /sbin/init 3
I can see an /etc/hosts entry for the hostname I specified in the container, fine.
When I add a second container in the same bridge
docker run -d --net my_bridge -h container_B -t bla:new /sbin/init 3
I’d like to have container_A and container_B in both /etc/hosts’s containers.
Is there a flag or something to allow that ? I didn’t see any so far.
If there’s not, is there a reason not to have this functionality ?
Otherwise I’d be happy to contribute.