Closed doug-w closed 4 years ago
When they are both using the VPN containers network stack, it is functionally localhost
for them.
So what is the solution?
Not ideal, I hardcoded 'vpn' as the hostname in my above example. That let A talk to B and B to A. I still wish that add-host had worked though.
Hi,
I have two containers that normally would talk to each-other through their container-name. When run under network_mode in a docker-compose.xml, there's no name resolution to the other containers also in the the same network_mode. However, I can resolve the names of other containers in the same docker-compose.yml file.
If I try to add a link in the compose-file it fails to start.
If I try extra_hosts specifying 127.0.0.1 it fails to start.
I've taken to changing references to host/ports in the container to be instead to 127.0.0.1:port.
Is there a way so container A on VPN V can ping container B also on VPN V?
Trimmed down docker-compose file: