Networking
To make your container able to communicate with the outside world, whether another server or another Docker container, Docker provides different ways of configuring networking. Let's begin with the network types which are available for our containers.
Docker network types
There are three different network types Docker delivers out of the box. To list them, execute the docker network ls
command:
$ docker network ls
Docker will output the list of available networks containing the unique network identifier, its name, and a driver which powers it behind the scenes:

To have an overview of the differences between various network types, let's describe them now one by one.
Bridge
This is the default network type in Docker. When the Docker service daemon starts, it configures a virtual bridge, named docker0
. If you do not specify a network with the docker run -net=<NETWORK>
option, the Docker daemon will connect the container to the bridge network by default. Also, if you create a new container...