Reputation: 3564
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 ?
Upvotes: 2
Views: 7450
Reputation: 404
I also was facing the same problem in windows with XAMPP installed
I resolved it by modifying the hosts file
/c/Windows/System32/drivers/etc
Just comment on the xampp IP and in this file you can also see the docker internal IP use it to access the application inside the container
Upvotes: 0
Reputation: 3564
The problem was with wamp
when I disabled it I was able to access the container via http://localhost:4400
Upvotes: 1
Reputation: 4253
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
Upvotes: 0