300-910 · Question #40
FILL BLANK Fill in the blanks to complete the statement. When creating multiple containers, in order to allow communication with each other, you must create a ___________ of type ___________.
To enable inter-container communication in Docker, you must create a user-defined network of type bridge. This allows containers on the same host to discover and talk to each other by name.
Question
Exhibit
Explanation
To enable inter-container communication in Docker, you must create a user-defined network of type bridge. This allows containers on the same host to discover and talk to each other by name.
Approach. In Docker, containers are network-isolated by default. To allow multiple containers to communicate, you create a custom Docker network of type bridge. A bridge network acts as a virtual switch on the host, and containers attached to the same bridge network can reach each other using their container names as DNS hostnames. The default bridge network exists automatically but does not support automatic DNS resolution - a user-defined bridge network is required for containers to resolve each other by name, which is why explicitly creating one is considered best practice.
Concept tested. Docker container networking - specifically, the requirement to create a user-defined bridge network so that containers can communicate with each other via name-based DNS resolution within the same Docker host environment.
Reference. Docker documentation: 'Use bridge networks' - https://docs.docker.com/network/bridge/
Topics
Community Discussion
No community discussion yet for this question.
