nerdexam
Cisco

200-901 · Question #535

Refer to the exhibit. An engineer is creating a Dockerfile for an application to run on a container. Application is a web application build on the Python Flask framework. Which port of the…

The correct answer is C. EXPOSE 80. In a Dockerfile, the EXPOSE instruction declares which ports a container expects to listen on, indicating its intended network reachability from outside.

Application Deployment and Security

Question

Refer to the exhibit. An engineer is creating a Dockerfile for an application to run on a container. Application is a web application build on the Python Flask framework. Which port of the Dockerfile provides desired reachability to the application from the outside of the container?

Exhibit

200-901 question #535 exhibit

Options

How the community answered

(52 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    94% (49)

Why each option

In a Dockerfile, the `EXPOSE` instruction declares which ports a container expects to listen on, indicating its intended network reachability from outside.

ARUN pip3 install Flask

`RUN pip3 install Flask` executes a command during the image build process to install Python dependencies, which is not related to network port exposure.

BMAINTAINER User One ([email protected])

`MAINTAINER User One ([email protected])` is a deprecated instruction used for setting metadata about the image author, unrelated to network ports.

CEXPOSE 80Correct

The `EXPOSE` instruction in a Dockerfile serves to document which ports a container will listen on at runtime, making it discoverable for inter-container communication or for publishing to the host. While it doesn't automatically publish the port, it's the declaration of intended network reachability.

DCOPY ./app

`COPY ./app` copies application source code from the build context into the Docker image, which is a file system operation and has no direct bearing on network port reachability.

Concept tested: Dockerfile EXPOSE instruction

Source: https://docs.docker.com/reference/dockerfile/#expose

Topics

#Docker#Dockerfile#Containerization#Network Ports

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice