How can i access the website running inside a Docker container using IP address of container

泪湿孤枕 提交于 2019-12-03 13:49:23

问题


How can i access the website running inside container at ip 172.20.128.2 .I do not want to do port forwarding and using host ip. I am aware that i can forward docker port on host port and can access using host IP but i do not want to do in this way. I am using docker 1.10


回答1:


This blog post explains many ways to reach your container from outside. Have a look Four ways to connect a docker container.

Be sure your web server is well configured testing at least once with -p option.

Also you can test with the --network host option

Regards



来源:https://stackoverflow.com/questions/40060764/how-can-i-access-the-website-running-inside-a-docker-container-using-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!