Chapter 2. Introduction to Container Networking

This chapter focuses on networking topics for single-host container networking, with an emphasis on Docker. We’ll also have a look at administrative challenges such as IP address management and security considerations. In Chapter 3, we will discuss multi-host scenarios.

Single-Host Container Networking 101

A container needs a host to run on. This can be a physical machine, such as a bare-metal server in your on-premises datacenter, or a virtual machine, either on premises or in the cloud.

In the case of a Docker container the host has a daemon and a client running, as depicted in Figure 2-1, enabling you to interact with a container registry. Further, you can pull/push container images and start, stop, pause, and inspect containers. Note that nowadays most (if not all) containers are compliant with the Open Container Initiative (OCI), and alongside Docker there are interesting alternatives, especially in the context of Kubernetes, available.

Simplified Docker architecture for a single host.
Figure 2-1. Simplified Docker architecture for a single host

The relationship between a host and containers is 1:N. This means that one host typically has several containers running on it. For example, Facebook reports that—depending on how beefy the machine is—it sees on average some 10 to 40 containers per host running.

No matter if you have a single-host deployment or use a cluster ...

Get Container Networking now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.