Networks are used in order for containers to be able to communicate between each other.

The different network drivers are:

  • bridge: the default network driver created by Docker if no network is defined. It created a layer between the container and the host. This is useful when you need multiple containers to communicate with the same Docker host.
  • host: removes the layer between the container and the host, and let the container use the host’s network directly. This is useful when you don’t want the network stack to be isolated, but all the other aspects of a container.
  • overlay: it allows to connect multiple Docker daemons together and so enables different swarms to communicate with each other. This is useful when you need containers that run on different Docker hosts to communicate, or when you have multiple applications that work togheter using swarm services.
  • macvlan: assigns a MAC address to a container that the Docker daemon will use in order to redirect traffic to them. This is used with legacy applications that expect to be connected to the physical networks and so to have their own MAC addresses.
  • none: disable all networking.