In the previous recipe, Docker by default attached our container to the default bridge network docker0 and then leveraged the DNAT rule of iptables to allow TCP connection from the external world. However, there are many use cases wherein the container needs full access to the host network namespace, such as the brctl show scenario in the introduction section of this chapter. In this recipe, we will attach one container to the default bridge network and another one to the host network and compare the differences.
Attaching containers to a host network
Getting ready
Before we begin, ensure that the Docker daemon is running and has access to the alpine image.