Skip to content
skillbld
Docker · 12-day planAll days
Day 5 of 12 25 min

Learn how network traffic reaches apps inside containers. Publish ports with -p, run several web servers side by side, understand port conflicts and random ports, and keep services private by binding to 127.0.0.1.

By the end of today you can

  • Explain why an app inside a container can't be reached until you publish its port
  • Publish ports with -p HOST:CONTAINER
  • Run several containers that use the same internal port
  • Fix "port is already allocated" errors
  • Publish a port only on your own machine with 127.0.0.1

What's inside

  • 4 sections
  • 2 diagrams and mind maps
  • 4 code examples you can run
  • 5-question quiz
  1. 1Publishing a port
  2. 2Many containers, same internal port
  3. 3When it goes wrong
  4. 4Keeping it private

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free

Keep going

Day 5: Ports · Docker · SkillBld