Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
Last active July 31, 2018 22:04
Show Gist options
  • Save mohanpedala/c106dff9a5b7d4194e65ae2d70a2d7ac to your computer and use it in GitHub Desktop.
Save mohanpedala/c106dff9a5b7d4194e65ae2d70a2d7ac to your computer and use it in GitHub Desktop.
Docker networking

Bridge

a bridge network uses a software bridge which allows containers connected to the same bridge network to communicate, while providing isolation from containers which are not connected to that bridge network. The Docker bridge driver automatically installs rules in the host machine so that containers on different bridge networks cannot communicate directly with each other.

Bridge networks apply to containers running on the same Docker daemon host. For communication among containers running on different Docker daemon hosts, you can either manage routing at the OS level, or you can use an overlay network.

  • User-defined bridges provide better isolation and interoperability between containerized applications.
  • User-defined bridges provide automatic DNS resolution between containers.

Reference click here

Overlay

The overlay network driver creates a distributed network among multiple Docker daemon hosts. This network sits on top of (overlays) the host-specific networks, allowing containers connected to it (including swarm service containers) to communicate securely. Docker transparently handles routing of each packet to and from the correct Docker daemon host and the correct destination container.

When you initialize a swarm or join a Docker host to an existing swarm, two new networks are created on that Docker host:

  • an overlay network called ingress, which handles control and data traffic related to swarm services. When you create a swarm service and do not connect it to a user-defined overlay network, it connects to the ingress network by default.
  • a bridge network called docker_gwbridge, which connects the individual Docker daemon to the other daemons participating in the swarm.

Reference click here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment