200-901 Application Deployment and Security Practice Question
A Docker container running a web application needs to be accessible on the host's port 8080. The application inside the container listens on port 80. Which docker run command achieves this?
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 -d -p 8080:80 myapp
The -p flag maps host ports to container ports. The correct syntax is -p <host-port>:<container-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 -d --expose 80 -p 8080 myapp
Why it's wrong here
--expose only exposes the port to linked containers, not to the host.
- ✗
docker run -d -p 80:8080 myapp
Why it's wrong here
This maps host port 80 to container port 8080, which is the reverse of what is needed.
- ✗
docker run -d -P 8080:80 myapp
Why it's wrong here
-P publishes all exposed ports to random host ports; specifying ports with -P is incorrect.
- ✓
docker run -d -p 8080:80 myapp
Why this is correct
This maps host port 8080 to container port 80, as required.
Go deeper
Related to this question
About these practice questions
One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.