Before we start to go into detail about Networking in Docker, I should mention that we have managed to make it to the fourth chapter in the book without having to really think about networking, this is because, by default, Docker creates a network bridge between the containers and your host machine's network interface. This is Docker networking at its most basic form.
Like basic storage, this limits you to bring up your containers on a single host even when using a clustering tool such as Docker Swarm, as you may have already noticed in Chapter 2, Introducing First-party Tools, when we were bringing up our WordPress installation, the web and database containers where launched on a single host within the cluster. If we were to try and bind each of the two containers to different host, they would not be able to talk to each other.
Luckily, Docker has you covered and provides its own multi-host networking layer to use with Docker Swarm.