Exploring Docker networking
In this section, we will discuss the networking options that are available in Docker and how you can use them to expose your containers to external users and systems. Docker includes various networking options to connect containers to your network, and if none of the included networking options fit your requirements, you can select from a number of third-party networking add-ons that offer features that may not be included in the base networking stack. By default, Docker networking focuses on a single host, but for more complex use cases, it includes networking features to facilitate cross-host networking by using Docker Swarm. Since the industry has moved away from using Docker Swarm to other offerings such as Kubernetes, this chapter will focus on single-host networking.
To avoid potential frustration when you expose containers, you should have a good understanding of how IP uses ports for communication. Many of you may know IP well, but we thought...