nerdexam
Docker

DCA · Question #114

You want to create a container that is reachable from its host's network. Does this action accomplish this? Solution: Use --link to access the container on the bridge network.

The correct answer is B. No. The --link option is used for inter-container communication on the same bridge network and does not expose a container to the host's network.

Submitted by deeparc· Apr 18, 2026Networking

Question

You want to create a container that is reachable from its host's network. Does this action accomplish this? Solution: Use --link to access the container on the bridge network.

Options

  • AYes
  • BNo

How the community answered

(31 responses)
  • A
    13% (4)
  • B
    87% (27)

Why each option

The `--link` option is used for inter-container communication on the same bridge network and does not expose a container to the host's network.

AYes

The `--link` option establishes a connection between containers and does not expose container ports to the host's network interface.

BNoCorrect

The `--link` option provides a legacy way for containers to discover and communicate with each other on the same bridge network using hostnames, but it does not expose the container's ports to the host machine. To make a container reachable from the host, port publishing (`-p` or `--publish`) is required.

Concept tested: Docker container network host reachability

Source: https://docs.docker.com/engine/reference/commandline/run/#link

Topics

#Docker Networking#Container Reachability#Port Mapping#--link

Community Discussion

No community discussion yet for this question.

Full DCA Practice