Whenever we want to connect one Docker container to another Docker container by the container name, then first we have to create a user-defined network. This is because Docker does not support automatic service discovery on the default bridge network. In this recipe, we will learn how to create our own bridge network.
Creating your first user-defined bridge network
How to do it...
Execute the docker network command to create a bridge network with the name as my-bridge-network, as follows:
$ docker network create my-bridge-network
325bca66cc2ccb98fb6044b1da90ed4b6b0f29b54c4588840e259fb7b6505331