Docker Certified Associate (DCA) — Question 25

You want to create a container that is reachable from its host’s network.
Does this action accomplish this?
Use either EXPOSE or --publish to access the container on the bridge network.

Answer options

Correct answer: B

Explanation

The correct answer is B because while EXPOSE can declare ports, it does not actually publish them to the host's network. The --publish option is required to map container ports to host ports, enabling access from the host's network.