Networking in Containers
The Sealed Parcels of Networking
In the Indian Postal System, each parcel is self‑contained with its own address label. But for delivery, parcels must pass through postal lanes and hubs. Similarly, containers have their own isolated networking but need bridges and overlays to communicate with the outside world.
Core Concepts
- Bridge Network → Default Docker network, like a local postal lane connecting parcels in the same colony.
- Host Network → Container shares host’s network, like a parcel delivered without a separate wrapper.
- Overlay Network → Connects containers across multiple hosts, like postal routes linking colonies across cities.
- MAC & IP Assignment → Each container gets its own mini address, like a parcel’s unique tracking number.
Hands‑On Exercise
docker network ls
docker run --network bridge nginx
docker run --network host nginx
Observe how containers connect like parcels moving through different postal lanes.
Real‑World Relevance
- Microservices rely on container networking for communication.
- DevOps pipelines use overlay networks for multi‑host deployments.
- Security requires isolating containers, like sealing parcels.

Updated on Dec 31, 2025