✦ For everyone, free.

Practical knowledge for real and everyday life

Home

7.2.1 Bridge Driver

A focused guide to Bridge Driver, connecting core concepts with practical Docker and container operations.

The bridge driver is Docker's default network driver, implementing a single-host virtual network using a Linux bridge, providing the foundation for both the automatically created default bridge network and any user-defined bridge networks created explicitly.

Creating a Network With the Bridge Driver

The bridge driver is the implicit default when creating a new network, though it can also be specified explicitly.

docker network create mynet
docker network create --driver bridge mynet2

Both of these create equivalent bridge networks, since bridge is the default driver when none is specified.

How the Bridge Driver Connects Containers

Containers attached to the same bridge network connect to a shared virtual switch (the bridge itself), with each container's veth pair acting as a virtual cable connecting it to this shared switch.

docker network inspect mynet --format '{{json .Containers}}'

This reveals every container currently connected to this particular bridge network.

Why the Bridge Driver Suits Single-Host Scenarios

The bridge driver's design is specifically suited to networking among containers on a single host — for multi-host scenarios (such as a Swarm cluster spanning several machines), the overlay driver is needed instead, since a bridge network cannot span multiple separate hosts.

docker network create --driver bridge single-host-net
Customizing a Bridge Network's Configuration

A bridge network's address range, gateway, and other settings can be customized at creation time, rather than relying on automatically chosen defaults.

docker network create --driver bridge --subnet=172.30.0.0/16 custom-bridge
Why the Bridge Driver Matters

As the default and most commonly used network driver, a solid understanding of how the bridge driver works underlies effective use of Docker networking for the large majority of everyday, single-host container networking scenarios.

Content in this section