When you create a container attached to the default Docker bridge network, how is its IP address assigned?
Think about how Docker manages networking for containers by default.
Docker's default bridge network uses an internal DHCP mechanism to assign IP addresses dynamically to containers from its subnet.
What is the output of the following command snippet that inspects the default bridge network's subnet?
docker network inspect bridge --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'The default Docker bridge network usually uses a private IP range starting with 172.
The default Docker bridge network typically uses the subnet 172.17.0.0/16 unless customized.
A container connected to the default bridge network cannot ping the host machine's IP address. What is the most likely reason?
Consider network security settings on the host machine.
Host firewalls often block traffic from Docker bridge subnet IPs, preventing containers from reaching the host IP.
You want two containers on the default bridge network to communicate by name. What must you do?
Think about Docker's networking features for name resolution.
The default bridge network does not support automatic DNS resolution by container name. User-defined bridge networks do.
What is the best practice to restrict container communication on the default Docker bridge network?
Consider multiple layers of network security controls.
Combining disabling inter-container communication, using isolated networks, and host firewall rules provides strong security.