简体   繁体   中英

Connecting to a Apache web server in a Docker from a remote server

I have installed Docker in a Linux environment. Inside this host, there is a Ubuntu container running. Apache Web server is running inside this container. I have mapped port 80 of this docker container to the host machine's port 50000.

When i try to access host machine from a remote browser, i'm unable to access it. I want to see the apache web server running on Ubuntu container. I access like this.

http://192.168.16.3:50000

Could someone let me know what might be the cause for this.

You need to route traffic from host server port 80 to your docker container port 50000. This can be done with iptables. http://blog.sequenceiq.com/blog/2014/08/12/docker-networking/

I ve also read that docker can run in host mode http://www.dasblinkenlichten.com/docker-networking-101-host-mode/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM