Introduction to networking concepts and the default bridge network.
By default, Docker provides a robust networking subsystem that allows containers to communicate with each other and with the outside world. When Docker is installed, it creates three networks automatically: `bridge`, `host`, and `none`. The most common one is the `bridge` network. When you start a container without specifying a network, it's attached to this default bridge network. Each container on this network gets an internal IP address, and they can communicate with each other using these IPs. However, automatic service discovery by container name is not supported on the default bridge network. The `host` network driver removes network isolation between the container and the Docker host. The container shares the host's networking namespace, so it can access network services on the host directly, and vice versa. This can offer performance benefits but sacrifices the security and portability of network isolation. The `none` network driver completely disables networking for a container, placing it in its own network stack with no external connectivity. While the default bridge is useful for simple cases, the best practice for applications involving multiple containers is to create custom user-defined bridge networks. This provides better isolation and, crucially, enables an embedded DNS server that allows containers to resolve each other's addresses by their names.