200-901 Application Deployment and Security Practice Question
In a docker-compose.yaml file, which key is used to define the container image to be built from a Dockerfile in the current directory?
⚠ Common exam trap
200-901 often tests the confusion between `build` and `image` keys, so candidates may choose `image` thinking it builds, but `image` only specifies a pre-built 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
✓
build
The `build` key in a docker-compose.yaml file specifies the build context and optionally the Dockerfile location, instructing Docker Compose to build an image from a Dockerfile in the current directory. This is the correct key for building an image rather than using a pre-built one.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
dockerfile
Why it's wrong here
dockerfile specifies an alternate Dockerfile filename inside the build context; it does not name the resulting image. It tempts because it is a real build sub-key, and it is correct when the Dockerfile is not the default 'Dockerfile' in that directory.
- ✗
image
Why it's wrong here
The image key names a pre-built image to pull from a registry; it does not trigger a build from a local Dockerfile. It tempts because image is the standard key for specifying what a service runs, and it is correct when consuming a published image rather than building one.
- ✗
context
Why it's wrong here
context sets the build directory sent to the daemon; alone it names no image, so Compose has nothing to tag or build. It appeals because context is genuinely part of the build block, and it is correct as the path component alongside a build directive, not as the image identifier.
- ✓
build
Why this is correct
The build key names the directory containing the Dockerfile, so Compose builds the image from that context rather than pulling a prebuilt one. Specifying image alone would only tag or fetch an existing image, failing the requirement to build from the current directory.
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.