Service discovery
Before we get any further, we really need to get deeply familiar with the conceptual Docker container connectivity, which is, unsurprisingly, in some ways very similar to building high-availability services with servers in a non-containerized world. Because of this, covering this topic in some depth will not only expand your understanding of Docker networking, but also help in generally building out resilient services.
A recap of Docker networking
In the previous chapter, we covered a bit of the Docker networking layout, so we will cover the main points here:
- By default, Docker containers run on an isolated virtual network on the host
- Each container has its own network address in that network
- By default,
localhost
for a container is not the host machine'slocalhost
- There is high overhead of manual work in order to connect containers manually
- Manual networking connections between containers are inherently fragile
In the parallel world of setting up a local server network, the base...