Q:

How to configure /etc/hosts to test local Docker setup

I'm trying to develop a web app locally using native Docker for OS X (beta) to handle the entire environment.
In order to fake the production DNS configuration (to test Nginx setup) I have edited the host file (at /private/etc/hosts):
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

# Added by me
0.0.0.0         www.mydomain.com

The Nginx config file is tested and is working on production server.
Expected behaviour:
When I point my browser to www.mydomain.com it should be redirected to ip 0.0.0.0 (Dockers default IP on OSX), and my containerized web app should appear. 
Actual behaviour:
The browser shows a "Failed to open page" error message. 
What am I missing here?

A:

you docker-for-mac ip ist not 0.0.0.0 - nothing has this ip. Use 127.0.0.1 if you are using docker-for-mac.
Also ensure, when you start docker, that you export the ports to the host, either by docker-compose or by docker run adding -p 80:80 when starting your web-container

