Docker Community Forums

Share and learn in the Docker community.

Ping linux container


(Albertofilho) #1

Howdy,

I’ve installed docker for windows with linux container.
Then I’ve build a website image and put to run on port 8080.
(command: docker run -d mywebsite -p 80:8080).

The problem is that I cant access my website from broswer using http://localhost:8080.

My ip address is 192.168.0.51 and my container ip is 172.17.0.2.

I know that I have to expose the port of my container, and I did it. But I still not able to ping the container ip nor access it from web browser.

Appreciate any help!

  • Alberto

(Martin Terp) #2

Hi :slight_smile:

the -p command, its the other way around, like:

docker run -d -p 8080:80 mywebsite

The 8080 in this case, is what it should LISTEN for, and the port 80, is what is listning in the container (im not sure its 80, it depends on the image)

Also note, that the -p should be BEFORE the image name