My docker container isn't starting on localhost (0.0.0.0) on Docker for Windows (Native using Hyper-V)

But when I run it, this is my output (noticed the different IP of the container)

Since this a Windows machine, I assume that you're using Docker Toolbox Docker for Windows. 10.0.75.2 is the IP of the boot2docker virtual machine.

If you are using Windows or Mac OS, you will need some form of virtualization in order to run Docker. The IP you just saw is the IP of that lightweight virtual machine.

And how can I get the same results as Digital Ocean's? (Getting the server to start on localhost)

Use a Linux distribution! Also you can enable Expose container ports on localhost in Docker For Windows Settings:

enter image description here


Despite you created the containers in your local machine. These are actually running on a different machine (a virtual machine)

First, check what is the IP of your docker machine (the virtual machine)

$docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM
default   *        virtualbox   Running   tcp://192.168.99.100  

Then run curl command (or open a browser) to view the default web site on your nginx web server inside the container

curl http://192.168.99.100:80

Tags:

Docker

Nginx