Docker networking
You'll learn how containers find each other and reach the outside world: user-defined networks and built-in DNS, port publishing, segmentation, internal, host and none networks, sidecars and compose. You'll look under the hood — DNAT in iptables and routes via nsenter — and fix a stack with several breaks.
- Containers can't find each other by nameeasy
- DNS in Docker: name, alias and resolvereasy
- Publishing ports: 127.0.0.1 vs 0.0.0.0easy
- EXPOSE doesn't publish a porteasy
- Segmentation: the storefront can't see the databasemedium
- A network with no way out: --internalmedium
- The host network and the none networkmedium
- A sidecar in someone else's network namespacemedium
- The service listens on 127.0.0.1 — neighbors can't reach itmedium
- The wrong neighbor address in environment variablesmedium
- docker compose: project networksmedium
- Network fact sheet: subnet, gateway and addressesmedium
- Port forwarding from the inside: DNAT in iptableshard
- A container's routes via nsenterhard
- A three-container stack: find the breakhard