7.2 Network Drivers
A focused guide to Network Drivers, connecting core concepts with practical Docker and container operations.
Network drivers are the different underlying implementations Docker provides for how a network actually behaves, with bridge being the most common for single-host scenarios, alongside other drivers suited to different networking needs such as host, none, overlay, and macvlan.
The Bridge Driver
The default and most commonly used driver, suitable for the typical case of multiple containers on a single host needing to communicate with each other and the outside world.
docker network create --driver bridge mynet
The Host Driver
This driver removes network isolation entirely, giving a container direct access to the host's own network namespace, useful in specific performance-sensitive scenarios but sacrificing the isolation a typical container otherwise provides.
docker run -d --network host myapp:1.0
The None Driver
This driver disables networking entirely for a container, appropriate for workloads that genuinely have no networking needs at all.
docker run -d --network none myapp:1.0
The Overlay Driver
Used specifically for multi-host networking in a Docker Swarm cluster, allowing containers running on different physical or virtual hosts to communicate as though they were on the same network.
docker network create --driver overlay --attachable myoverlaynet
The Macvlan Driver
This driver assigns a container a MAC address, making it appear as a physical device directly on the network, useful for specific legacy applications expecting this kind of direct network presence.
docker network create --driver macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=eth0 mymacvlannet
Why Understanding Network Drivers Matters
Recognizing that different network drivers exist for fundamentally different networking needs — single-host bridging, host-level access, multi-host overlay networking, direct physical network presence — helps in choosing the appropriate driver for a given scenario, rather than defaulting to bridge for situations that actually call for a different approach.