Docker image NGINX not exposing : site cannot be reached

For me in Windows instead of pointing to localhost i used the resulted ip of running the command:

docker-machine ip default

The problem was that I was running it on VM on windows which happens with docker .

So in one of the beginner tutorials it was mentioned that the port is forwarded to this VM port not on the windows port. (Just read the note below the hello world! browser image)

So you have to find the ip address of your VM OS and paste it in the browser along with the port number.


You should run:

docker run -d -p 8888:80 nginx

docker run -d -p 80:80 nginx

-d parameter, Run container in background and print container ID


Use the command to get the ip:

docker-machine ip default

and then used http:\\ip:port\ to access nginx

Tags:

Docker

Nginx