Skip to main content

Networking

Docker creates a software-defined network layer that controls how containers communicate with each other and the outside world. This module covers network drivers, port publishing, DNS-based service discovery, Compose networking, and troubleshooting connectivity issues.

How Docker Networking Works

flowchart TD
subgraph Host["Docker Host"]
subgraph Bridge["User-Defined Bridge Network"]
A["Container A<br/>(web)"] <-->|"DNS: api"| B["Container B<br/>(api)"]
B <-->|"DNS: db"| C["Container C<br/>(db)"]
end
P["Published Port<br/>Host:8080 → web:80"]
end
Internet <-->|"Port 8080"| P
P <--> A

style Bridge fill:#e3f2fd,stroke:#1565c0
style P fill:#fff3e0,stroke:#ef6c00

What You Will Learn

LessonWhat It Covers
Network DriversBridge, host, none, and macvlan -- when to use each
Port PublishingExposing container services to the host and outside world
DNS and Service DiscoveryHow containers find each other by name
Networking with ComposeDesigning network topology in multi-service stacks
TroubleshootingDiagnosing connectivity failures step by step

Prerequisites

  • Have Docker Engine installed (Module 2)
  • Understand containers and docker run (Module 4)