Courseiva
Application Deployment and SecurityeasyMultiple ChoiceObjective-mapped

200-901 Application Deployment and Security Practice Question

A developer creates a Dockerfile with the following content: FROM python:3.9-slim, COPY app.py /app/, RUN pip install flask, EXPOSE 5000, CMD ["python", "/app/app.py"]. When building the image with 'docker build -t myapp .', what is the purpose of the EXPOSE instruction?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

It informs Docker that the container listens on port 5000, but the port must be published at runtime.

EXPOSE documents that the container listens on port 5000 at runtime. It does not publish the port; that requires -p flag when running the container.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • It automatically publishes port 5000 to a random host port.

    Why it's wrong here

    EXPOSE does not publish ports; -p flag is needed.

  • It informs Docker that the container listens on port 5000, but the port must be published at runtime.

    Why this is correct

    EXPOSE documents the port, but publishing requires -p.

  • It installs the Flask framework on port 5000.

    Why it's wrong here

    Flask is installed by RUN pip, not by EXPOSE.

  • It maps host port 5000 to container port 5000.

    Why it's wrong here

    Mapping requires -p flag.

About these practice questions

This 200-901 question is part of Courseiva's 989-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.