Introduction to Docker Overlay Networking
This lesson is an overview of Docker Overlay Networking.
We'll cover the following
Overlay networks are at the center of most cloud-native microservices apps, and this chapter will get you up to speed on how they work in Docker.
Let's do some networking magic!
The TLDR
Real-world containers need a reliable and secure way to communicate without caring which host they’re running on or which networks those hosts are connected to. This is where overlay networks come into play — they create flat, secure, layer 2 networks that span multiple hosts. Containers on different hosts can connect to the same overlay network and communicate directly.
Docker offers native overlay networking that is simple to configure and secure by default.
Behind the scenes, Docker builds overlay networking on top of libnetwork
and the native overlay driver. Libnetwork is the canonical implementation of the Container Network Model (CNM), and the overlay driver implements all of the machinery to build overlay networks.
The deep dive
In March 2015, Docker, Inc. acquired a container networking startup called Socket Plane with two goals in mind:
Bring overlay networking to Docker
Make container networking simple for developers
They accomplished both goals, and overlay networking continues to be at the heart of container networking in 2024 and the foreseeable future.
However, there’s a lot of complexity hiding behind the simple Docker commands. Knowing the commands is probably enough if you’re a casual Docker user. However, if you plan to use Docker in production, especially if you plan to use Swarm and Docker networking, then the things we’ll cover will be vital.
Get hands-on with 1300+ tech skills courses.