I run an Ubuntu inside a VirtualBox VM on a Mac OS.
I create a container. I place a server inside it that listens on port 8000. Did not export port 8000.
In the host (Ubuntu), I use Firefox to go to localhost:8000 . No access. Expected behavior.
Then I use the container’s IP address “172.17.0.2:8000”. Access granted. I’m surprised.
Newbie here. Does it have anything to do with phusion/baseimage?
There is nothing wrong with the phusion baseimage.
The one you saw is the expected behaviour. If you dont expose the port using -p/-P while running container, the port will only be accessible using the container IP address.