What is a single-host bridge?

The simplest type of Docker network is the single-host bridge network.

The name tells us two things:

  • Single-host tells us it only exists on a single Docker host and can only connect containers that are on the same host.
  • Bridge tells us that it’s an implementation of an 802.1d bridge (layer 2 switch).

Docker on Linux creates single-host bridge networks with the built-in bridge driver, whereas Docker on Windows creates them using the built-in nat driver. For all intents and purposes, they work the same.

Example

The figure below shows two Docker hosts with identical local bridge networks called “mynet”. Even though the networks are identical, they are independent isolated networks. This means the containers in the picture cannot communicate directly because they are on different networks.

Get hands-on with 1200+ tech skills courses.