I m using docker for windows but my docker container isn t starting on localhost 0 0 0 0 What is the solution to this

0 votes

When I run a container, this happens:

C:\>docker run --name docker-nginx -p 80:80 -d nginx
d3ccb73a91985651ec61231bca9f9c716f0dec807e354a29eeef2144f883a01c
C:\>docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                           NAMES
d3ccb73a9198        nginx               "nginx -g 'daemon off"   14 hours ago        Up 2 seconds        10.0.75.2:80->80/tcp, 443/tcp   docker-nginx

I cant seem to start it on localhost, can someone help me with this?

Aug 30, 2018 in DevOps & Agile by Sophie may
• 10,610 points
880 views

1 answer to this question.

0 votes

This happens because your docker containers are actually running on a virtual machine.

1st step would be to check what the IP of your docker machine (virtual machine) is :

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

Then run curl command which will show the default web site on your nginx web server inside the container

curl http://192.168.99.100:80
answered Aug 30, 2018 by Tyrion anex
• 8,700 points

Related Questions In DevOps & Agile

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,474 views
0 votes
2 answers

How to customize the RAM allocation on Docker for Windows?

Try this: docker update --cpu-shares 5120 -m 3000M ...READ MORE

answered Dec 7, 2018 in DevOps & Agile by Maverick
• 10,840 points
5,105 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP