200-901 Application Deployment and Security Practice Question
In Docker, which command is used to build an image from a Dockerfile and tag it as 'myapp:v1'?
⚠ Common exam trap
Cisco often tests the distinction between `docker build` (for creating images from a Dockerfile) and `docker run` (for starting containers), and the trap here is that candidates confuse the `-t` flag in `docker run` (which allocates a TTY) with the `-t` flag in `docker build` (which tags the image).
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 build -t myapp:v1 .
The `docker build -t myapp:v1 .` command builds a Docker image from the Dockerfile in the current directory and tags it with the name `myapp` and version tag `v1`. The `-t` flag assigns the tag, and the dot (`.`) specifies the build context (the current directory). This is the standard Docker command for building and tagging images.
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 -t myapp:v1 .
Why it's wrong here
Incorrect. docker run runs a container, not builds an image.
- ✓
docker build -t myapp:v1 .
Why this is correct
Correct. The -t flag assigns the tag 'myapp:v1'.
- ✗
docker create myapp:v1 .
Why it's wrong here
Incorrect. docker create creates a container, not an image.
- ✗
docker commit myapp:v1 .
Why it's wrong here
Incorrect. docker commit creates an image from a container, but not from a Dockerfile.
Go deeper
Related to this question
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 →
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.