Beginner Docker & Containers
Q23 / 100

What is the purpose of the "EXPOSE" instruction in a Dockerfile?

Correct! Well done.

Incorrect.

The correct answer is B) It documents which ports the container listens on at runtime, serving as informational metadata (does not by itself publish the port)

B

Correct Answer

It documents which ports the container listens on at runtime, serving as informational metadata (does not by itself publish the port)

Explanation

EXPOSE is documentation/metadata about which ports the application uses; actually publishing a port to the host still requires the "-p" flag on "docker run".

Progress
23/100