So far, we successfully launched an HTTP service and accessed the service from the Docker host as well as another container within the same Docker host. Furthermore, as demonstrated in the Building images from containers section of Chapter 2, Handling Docker Containers, the container is able to successfully install the wget package by making a connection to the publicly available APT repository over the Internet. Nonetheless, the outside world cannot access the service offered by a container by default. At the outset, this might seem like a limitation in the Docker technology. However, the fact is, the containers are isolated from the outside world by design.
Docker achieves network isolation for the containers by the IP address assignment criteria, as enumerated here:
- Assigning a private IP address to the container, which is not reachable from an external network
- Assigning an IP address...