Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access webserver running in docker container from browser?

Tags:

docker

I'm trying to deploy the MDT(Mobile Distribution Tool) on my local Mac.

I'm using docker and have managed to get the container running..

enter image description here

In the image you can see MDT running on port 4000. But when I browse to my machine browser on "localhost:4000", I get a timeout.

I've gone through this post and tried to add a route, but didn't work and then I visited this question and now I'm totally confused. Can someone please suggest how to get this resolved?

like image 294
Audi Avatar asked Oct 05 '17 10:10

Audi


1 Answers

When publishing a container port eg 8080:8080 (host_port:container_port).. Make sure the container port is the same on which your web service is running...

My webserver was listening for connections on 8080 port and in the screenshot as you can see.. I have given 4000 port

like image 61
Audi Avatar answered Sep 23 '22 15:09

Audi