nerdexam
DockerDocker

DCA · Question #115

DCA Question #115: Real Exam Question with Answer & Explanation

The correct answer is A: Yes. Using --publish (or -p) explicitly maps container ports to host ports, making the container reachable from the host's network, while EXPOSE merely documents the ports.

Submitted by emma.c· 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 either EXPOSE or --publish to access the containers on the bridge network

Options

  • AYes
  • BNo

Explanation

Using --publish (or -p) explicitly maps container ports to host ports, making the container reachable from the host's network, while EXPOSE merely documents the ports.

Common mistakes.

  • B. The --publish option specifically enables host-to-container port mapping, making the container accessible from the host network.

Concept tested. Docker container port publishing

Reference. https://docs.docker.com/engine/reference/run/#publish-or-expose-port-s

Topics

#Port mapping#Container networking#EXPOSE command#Publish ports

Community Discussion

No community discussion yet for this question.

Full DCA PracticeBrowse All DCA Questions