Dissecting the container network model
So far, we have mostly worked with single containers, but in reality, a containerized business application consists of several containers that need to collaborate to achieve a goal. Therefore, we need a way for individual containers to communicate with each other. This is achieved by establishing pathways, which we can use to send data packets back and forth between containers. These pathways are called networks. Docker has defined a very simple networking model, the so-called container network model (CNM), to specify the requirements that any software that implements a container network has to fulfill. The following is a graphical representation of the CNM:
Figure 10.1 – The Docker CNM
The CNM has three elements – sandboxes, endpoints, and networks:
- Network Sandboxes: The sandbox perfectly isolates a container from the outside world. No inbound network connection is allowed into the sandboxed...