easyMultiple Choice
200-901 Practice Question: Which Docker command is used to build an image…
Which Docker command is used to build an image from a Dockerfile?
⚠ Common exam trap
Cisco often tests the distinction between commands that create containers (`docker run`, `docker create`) and the command that builds images (`docker build`), hoping candidates confuse the purpose of `docker run` with image creation.
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
The `docker build` command reads the instructions in a Dockerfile and assembles a Docker image layer by layer. Each instruction in the Dockerfile (e.g., FROM, RUN, COPY) creates a new layer that is cached and reused, making subsequent builds faster. This is the standard and only command designed specifically for building images from a Dockerfile.
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
Why it's wrong here
docker run instantiates a container from an existing image; it never reads a Dockerfile or produces an image layer. It is the right command for starting a container interactively or detached, which is why it is confused with build, but image creation requires docker build.
- ✗
docker commit
Why it's wrong here
docker commit snapshots a running container's filesystem changes into a new image, bypassing the Dockerfile entirely. It is the correct tool for capturing manual in-container tweaks, but it cannot parse instructions such as FROM, RUN or COPY, so it does not build from a Dockerfile.
- ✓
docker build
Why this is correct
`docker build` reads a Dockerfile and constructs an image layer by layer, satisfying the stem's requirement to build an image from a Dockerfile. It parses instructions such as FROM, RUN and COPY, committing each layer, then tags the resulting image locally so containers can be created from it.
- ✗
docker create
Why it's wrong here
docker create only allocates a container from an existing image and leaves it stopped; no Dockerfile is parsed and no image is produced. It is correct when you need a prepared container without starting it, but building an image requires docker build.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 975 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.