Conceptual
Login

Docker Port Publishing

-p HOST:CONTAINER makes docker-proxy and a DNAT rule forward traffic from a host port to the container's port, making it reachable from outside the host. This is distinct from EXPOSE, which is pure metadata: an exposed port is documented and reachable from other containers on the same network, but publishing is what opens it to the host and beyond.

This Concept is waiting for its first lesson!

-p HOST:CONTAINER makes docker-proxy and a DNAT rule forward traffic from a host port to the container's port, making it reachable from outside the host. This is distinct from EXPOSE, which is pure metadata: an exposed port is documented and reachable from other containers on the same network, but publishing is what opens it to the host and beyond.

Are you a teacher? Sign in to start contributing.

Sign In