docker0 bridge
docker0 bridge is the heart of default networking. When the Docker service is started, a Linux bridge is created on the host machine. The interfaces on the containers talk to the bridge and the bridge proxies to the external world. Multiple containers on the same host can talk to each other through the Linux bridge.
docker0 can be configured via the --net
flag, and has four modes in general:
--net default
: In this mode, the default bridge is used as the bridge for containers to connect to each other--net=none
: With this flag, the container created is truly isolated and cannot connect to the network--net=container:$container2
: With this flag, the container created shares its network namespace with the container named$container2
--net=host
: In this mode, the container created shares its network namespace with the host
Troubleshooting Docker bridge configuration
In this section, we will look at how the container ports are mapped to host ports and how we can troubleshoot the...