Courseiva
easyMultiple ChoiceObjective-mapped

200-901 Practice Question: A developer wants to ensure that a Docker…

A developer wants to ensure that a Docker container running a web application can only accept incoming traffic on port 443. Which Docker run option should be used?

⚠ Common exam trap

Cisco often tests the distinction between `--expose` (documentation only) and `-p` (actual port publishing), and the trap here is that candidates confuse `--expose` with making a port externally accessible, when in fact it only informs Docker that the container uses that port internally.

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

docker run -p 443:443 myapp

The `-p 443:443` flag publishes container port 443 to the host port 443, mapping incoming traffic on the host's port 443 to the container's port 443. This ensures the web application inside the container only accepts incoming traffic on port 443, as the host firewall and Docker's port mapping restrict access to that specific port.

Answer analysis

Option-by-option breakdown

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

  • docker run --port 443 myapp

    Why it's wrong here

    There is no --port flag; the correct flag is -p or --publish.

  • docker run --net host myapp

    Why it's wrong here

    --net host shares the host network stack, exposing all host ports, which is too permissive.

  • docker run -p 443:443 myapp

    Why this is correct

    -p 443:443 publishes container port 443 to host port 443, allowing external access only on that port.

  • docker run --expose 443 myapp

    Why it's wrong here

    --expose only documents ports but does not publish them; the port is still not accessible from outside.

About these practice questions

Courseiva writes every 200-901 question from scratch — 989 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.