As we already know, when the Docker daemon starts, it creates a bridge called docker0, and all the containers will get the IP from it. Sometimes, we might want to use a different bridge for some of our containers. Let's see how we can do that in this recipe.
Building your own bridge for container communication
Getting ready
I am assuming you already have Docker set up.
How to do it...
Follow these steps:
- Create a new custom bridge with the name br0:
$ docker network create br0 --subnet 192.168.2.1/24
- Confirm that the network has been created:
$ docker...