Search code examples
dockerdocker-for-windows

Docker desktop for windows: Can't access my container via the browser


I'm trying to run httpd container
The ip address is 172.17.0.2 (I'm sure of it cause I've ran docker container inspect <container_name>) and I the port is 4400 and when I run the container can't access it via the browser on this address http://172.17.0.2:4400 !
I've tried to disable the firewall but still the same problem.

This is how I started it:

docker container run -d -p 4400:8080 httpd


This is what docker container ls give me

CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS              PORTS                            NAMES
e9f92cfceb76        httpd               "httpd-foreground"   24 minutes ago      Up 13 minutes       80/tcp, 0.0.0.0:4400->8080/tcp   interesting_wright

What am I missing ?


Solution

  • docker run -dit --name my-apache-app -p 4400:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
    

    And then user your localhost + that port, and/or the LAN IP + that port.

    Reference: https://hub.docker.com/_/httpd