Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 210
thinkingmonster Avatar asked Oct 19 '22 00:10

thinkingmonster


1 Answers

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

like image 117
Carlos Rafael Ramirez Avatar answered Oct 21 '22 04:10

Carlos Rafael Ramirez