200-901 docker run vs docker start Practice Question
A developer wants to run a container in the background with port mapping and a named volume. Which command accomplishes this?
⚠ Common exam trap
This question tests whether you know that both `-v` and `--mount` (without explicit `type=volume`) are valid syntaxes for mounting a named volume. Candidates often mistakenly believe `--mount` requires `type=volume` or that only one syntax is correct.
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 myvol:/data --name myapp nginx
Options A and C are both correct. Option A uses the `-v` flag to mount a named volume, which is a shorthand for volume mounting. Option C uses the `--mount` flag; when `type=volume` is omitted, it defaults to a volume mount, so `--mount source=myvol,target=/data` is equivalent to `-v myvol:/data`. Both commands create a new container in detached mode (`-d`), map port 8080 on the host to port 80 in the container (`-p 8080:80`), mount the named volume `myvol` to `/data`, and name the container `myapp`. Option B is incorrect because `docker start` only starts an existing container and cannot create a new one or specify port mapping or volumes.
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 -p 8080:80 -v myvol:/data --name myapp nginx
Why this is correct
Correct. The `-v myvol:/data` syntax creates a named volume `myvol` if it doesn't exist and mounts it to `/data`. Combined with `-d`, `-p 8080:80`, and `--name myapp`, it meets all requirements.
- ✗
docker start -d -p 8080:80 -v myvol:/data --name myapp nginx
Why it's wrong here
Incorrect. `docker start` does not create a new container; it only starts an existing one. You cannot specify port mappings or volumes with `docker start`.
- ✓
docker run -d -p 8080:80 --mount source=myvol,target=/data --name myapp nginx
Why this is correct
Correct. The `--mount source=myvol,target=/data` syntax, without specifying `type`, defaults to a volume mount, making it functionally identical to `-v myvol:/data`. It also uses `-d`, `-p`, and `--name`, so it fulfills all requirements.
Go deeper
Related to this question
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 →
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.