Services and User Management

An administrator creates a user-defined bridge network with docker network create appnet and attaches several containers to it. Which three statements are correct? (Choose three.)

Choose 3 answers

Show the answer

Correct answersA. Containers on appnet can reach each other on any port they listen on without publishing those ports with -p.B. Containers on appnet can resolve each other by container name.D. Using -p 5353:53/udp publishes a UDP port, because publishing defaults to TCP when no protocol is given.

AWhy this is right: Containers on the same user-defined bridge talk directly; -p only exposes ports to the host.

BWhy this is right: Docker's embedded DNS resolves container names on user-defined networks.

CWhy not this: With --network host the container uses the host's stack, so -p is ignored and nothing is remapped.

DWhy this is right: Published ports default to TCP, so /udp is needed for a UDP port.

EWhy not this: Embedded DNS resolves names only within the same user-defined network, not across to the default bridge.

FWhy not this: docker network rm refuses a network that still has containers attached; it never removes containers.

Containers on the same user-defined bridge reach each other directly and resolve names through Docker's embedded DNS, and /udp selects UDP over the TCP default. With host networking the container shares the host's network stack, so -p mappings do not apply and no remapping occurs. Name resolution works only within a user-defined network, and docker network rm refuses a network that still has containers attached.