Why Docker container is running but localhost shows only "it works"?

Viewed 522

I used Docker version 19.03.13 and run Docker in Windows 10.

To reproduce the problem:

  1. Run command line as below (this is from the Docker 101)

docker run -d -p 80:80 docker/getting-started

  1. Confirm the container is running by execute the command line as below

docker ps and docker info

  1. open localhost in web browser
  2. The localhost shows the "it works!" page only, nothing related to the docker/getting-started page.

Not sure why the container is running, but localhost is not connect to it and only showing the "it works" page?

Here's the "it works" page enter image description here

1 Answers

i would clear your temporary internet files and cookies, and to go further, stop the container, and use the fuser command. An example is shown below,

fuser -v -n tcp 80
-v is for verbose mode, and -n is used to select the corresponding name space.

If an application is using port 80, then you can stop this program, or change the port you would like to use for your container.

Related