nerdexam
Docker

DCA · Question #116

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

The correct answer is B. No. Using docker network attach connects a container to an existing network, which facilitates inter-container communication but does not inherently expose container ports to the host's network.

Submitted by obi.ng· 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 network attach to access the containers on the bridge network

Options

  • AYes
  • BNo

How the community answered

(36 responses)
  • A
    11% (4)
  • B
    89% (32)

Why each option

Using `docker network attach` connects a container to an existing network, which facilitates inter-container communication but does not inherently expose container ports to the host's network.

AYes

`docker network attach` connects a container to an internal network but does not expose its services to the host system.

BNoCorrect

The `docker network attach` command connects an existing container to a specified network, allowing it to communicate with other containers on that network. However, it does not, by itself, publish container ports to the host machine's network interface, which is required for host reachability.

Concept tested: Docker container network attachment vs. exposure

Source: https://docs.docker.com/engine/reference/commandline/network_attach/

Topics

#Docker Networking#Bridge Network#Container Reachability#Port Mapping

Community Discussion

No community discussion yet for this question.

Full DCA Practice