Concepts / Containers and cloud networking

Containers and cloud networking

Published port

Also called docker run -p, port publishing, port mapping, container port

A host port forwarded to a container's port with a DNAT rule, so others reach a container through its host.

Containers sit on a private bridge network behind their host's NAT: they reach out, nobody reaches in. docker run -p 8080:80 publishes a port: the host gets a DNAT rule sending its port 8080 to the container's port 80, the same rewrite as a home router's port forward. Docker also adds docker-proxy for traffic from the host itself, and -p 127.0.0.1:8080:80 publishes to the host alone.

See it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Start this lab, free