I have created some Docker containers on two different hosts machine, MAc OSX and Ubuntu 16.04
Taken one by one they are served correctly via HTTP by each HOST Machine. The problem comes when I need hosted container to resolve each other on Ubuntu. (On Mac osx everything is working fine)
On both Host machines I have edited the /etc/hosts file like:
192.168.0.13 mycontainer01.dev
192.168.0.13 mycontainer02.dev
192.168.0.13 mycontainer03.dev
(on second host machine I have other IP clearly)
If I ping mycontainer01.dev from (outside) each host machine I get back the IP correct as defined in hosts file.
But If I enter the nginx container:
docker-compose exec nginx bash
on macosx ping mycontainer01.dev will succeed
on Ubuntu will return error: $ ping myconteiner01.dev
ping: bad address