Mapping a docker container to specific IP

I am running a minimal flask app on a docker container. I am using
port = int(os.environ.get(‘PORT’, 80)), host=‘’, port=port)
In order for the webapp to be accessible from my ip address. But I can’t access it from my ip address using :80.
Also, inspecting the container I see it is * Running on which corresponds to docker.


Did you map port 80 into the container?

Also, in my a big Flask guy, but i would expect it to be running on “” as you defined

Hi! Thanks for your reply. Yeah exactly, so it runs perfect on and localhost:80. And I use: docker run -p 80:80 -d image_name in order to run the container. But I can’t access it on my ip using :80, I have firewall off.

When you say “my ip” what is it then?

what happends if your application listens on and you try, from your mac, and curl http://localhost

Yeah so both and http://localhost work. but when I try accessing it from my IP address in the format, I try to paste it in the browser and add the port, so I can’t access it. I have also tried to run it on a VM but I had the same issue. Not sure why :confused:

Just for fun, can you try a port different from 80, like “-p 8080:80” ?

I tried it and it has the same outcome, I can access the webapp on and http://localhost but not from my IP