

This can be a risk, as unrelated stacks/services/containers are then able to communicate.

User-defined bridges provide better isolation.Īll containers without a -network specified, are attached to the default bridge network. Gets complex with more than two containers which need to communicate.Īlternatively, you can manipulate the /etc/hosts files within the containers,īut this creates problems that are difficult to debug. These links need to be created in both directions, so you can see this To manually create links between the containers (using the legacy -linkįlag). If you run the same application stack on the default bridge network, you need Your containers web and db, the web container can connect to the db containerĪt db, no matter which Docker host the application stack is running on. Imagine an application with a web front-end and a database back-end. On a user-defined bridge network, containers can resolve User-defined bridges provide automatic DNS resolution between containers.Ĭontainers on the default bridge network can only access each other by IPĪddresses, unless you use the -link option, which isĬonsidered legacy.

Differences between user-defined bridges and the default bridge User-defined bridge networks are superior to the default bridge You can also create user-defined custom bridge When you start Docker, a default bridge network (alsoĬalled bridge) is created automatically, and newly-started containers connect

Theĭocker bridge driver automatically installs rules in the host machine so thatĬontainers on different bridge networks cannot communicate directly with eachīridge networks apply to containers running on the same Docker daemon host.įor communication among containers running on different Docker daemon hosts, youĬan either manage routing at the OS level, or you can use an Isolation from containers which are not connected to that bridge network. In terms of Docker, a bridge network uses a software bridge which allowsĬontainers connected to the same bridge network to communicate, while providing A bridge can be a hardwareĭevice or a software device running within a host machine’s kernel. Which forwards traffic between network segments. In terms of networking, a bridge network is a Link Layer device
