beginnerDocker Networking: Bridge, Host, Overlay, DNS & Port Mapping

How does Docker route external traffic into a container?

Publishing a port (-p hostPort:containerPort) causes Docker to install an iptables DNAT (destination NAT) rule on the host. Traffic arriving at the host's published port is rewritten to target the container's internal IP and port on its bridge network, then delivered across the virtual ethernet (veth) pair into the container's network namespace.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

How does Docker route external traffic into a container?

Next Step

Continue to What is the difference between EXPOSE and -p in terms of networking?← Back to all Docker questions