advancedTop 100 Interview Questions

How does Docker implement published ports under the hood?

Through iptables DNAT (Destination NAT) rules on Linux, which rewrite incoming traffic on the published host port to be forwarded to the container's internal IP and port on the bridge network.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What's the difference between `docker compose up` and `docker compose up -d`?← Back to all Docker questions