I have a few docker containers running on the same machine and one of them is a reverse proxy to route traffic to the others. I have an docker network that they all connect to that i created with docker network create net_name
and each container uses that network in their docker compose file. I also specify a hostname
attribute for each container, this allows the reverse proxy container to simply use their hostname instead of a set IP address.
One of these containers needs to be network_mode: host
due to multicast DNS requirement. I noticed that this is the only network where I cannot use the hostname instead of the IP address of the machine with the container.
Does network_mode: host
override a defined network in a docker-compose and make it so the hostname can’t be found by other docker containers connected to that same network?