How Docker networking works by default
bridge network, docker0 interface, container IP assignment, default bridge, host network, none network, network isolation
Docker's Default Network Model
Every container gets a virtual network interface connected to a virtual bridge — docker0 by default. Docker assigns each container a private IP (typically in the 172.17.0.0/16 range). Containers on the same bridge can reach each other by IP.
Three Built-in Network Drivers
bridge (default): Containers connect to a virtual Ethernet bridge. Good for most use cases. Containers on the same custom bridge can resolve each other by container name.
host: The container uses the host's network stack directly. No port mapping needed, but no network isolation. Linux-only.
none: No networking. Container is fully isolated from all networks. Useful for pure compute tasks.
# Run using host network
docker run --network host nginx
# Run with no network
docker run --network none my-job
Container-to-Container Communication
On the default bridge, containers can reach each other by IP but not by name. DNS resolution only works on custom bridges — a critical distinction.
docker network ls # List all networks
docker network inspect bridge # See connected containers and their IPs
