200-901 Application Deployment and Security Practice Question
A developer wants to run a Docker container in detached mode, mapping host port 8080 to container port 80, and mounting a host directory for persistent data. Which command accomplishes this?
⚠ Common exam trap
200-901 often tests the distinction between `docker run` and `docker start`, and the correct flags for detached mode and port/volume mapping, causing candidates to confuse interactive mode (`-it`) with detached mode (`-d`) or to incorrectly use `docker start` with creation flags.
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 -v /host/data:/container/data myapp
The correct command is `docker run -d -p 8080:80 -v /host/data:/container/data myapp`. The `-d` flag runs the container in detached mode (in the background), `-p 8080:80` maps host port 8080 to container port 80, and `-v /host/data:/container/data` mounts the host directory `/host/data` to the container directory `/container/data`. This combination directly satisfies all requirements: detached mode, port mapping, and persistent volume mount.
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 -it -p 8080:80 -v /host/data:/container/data myapp
Why it's wrong here
The -it flags allocate an interactive terminal and keep stdin open, which contradicts detached mode; -d is required instead. It is tempting because -it is the standard pattern for interactive debugging sessions where you need a live shell inside the container.
- ✓
docker run -d -p 8080:80 -v /host/data:/container/data myapp
Why this is correct
The -d flag detaches the container, -p 8080:80 maps host port 8080 to container port 80, and -v /host/data:/container/data mounts the host directory for persistence. Together these satisfy the detached, port-mapped, volume-mounted requirements in one command.
- ✗
docker start -d -p 8080:80 -v /host/data:/container/data myapp
Why it's wrong here
docker start only restarts an existing stopped container and accepts no -p or -v flags, so it cannot create the mapping or mount. It is tempting because -d is valid here, and start is used to resume containers previously created with those settings.
- ✗
docker compose up -d -p 8080:80 -v /host/data:/container/data myapp
Why it's wrong here
docker compose up reads a YAML file and accepts no -p, -v or image arguments on the command line, so these flags are invalid. It is tempting because Compose genuinely defines ports and volumes declaratively, and -d does run services detached.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 975-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 →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
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.