Reputation: 18120
I ran
docker run -p 4000:4000 docs/docker.github.io
and the output shows
Docker docs are viewable at:
http://0.0.0.0:4000
however when I go to this address I get an error
This site can’t be reached
The web page at http://0.0.0.0:4000/ might be temporarily down or it may
have moved permanently to a new web address.
ERR_ADDRESS_INVALID
Upvotes: 6
Views: 17270
Reputation: 81
What I found using Docker for Windows is that the references to localhost or 0.0.0.0 didn't work at all when I tried to access the application in the browser. It's using Docker Quickstart Terminal which runs a Linux image on Windows and it runs Docker inside that
This command provides the IP address of the Linux image
docker-machine ip
When I use that address on my Windows browser it works fine, for example:
Upvotes: 8
Reputation: 264156
0.0.0.0 is a listener address that indicates all network interfaces on a machine, you don't connect to this address because it doesn't exist. Instead, you need to connect your browser to the IP address or name of the docker host. If you're running this locally, without docker-machine, that would be http://127.0.0.1:4000. With docker-machine, you can get the IP of the VM from the docker-machine ip
output.
Upvotes: 7