EX200 Manage containers Practice Question
Which file should be present in a directory to build a container image using 'podman build'?
⚠ Common exam trap
Red Hat often tests the distinction between files used for building images (Dockerfile/Containerfile) versus files used for orchestrating containers (docker-compose.yml) or excluding files (.dockerignore), leading candidates to mistakenly select A or D as required files.
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
✓
Dockerfile (or Containerfile)
The `podman build` command requires a Dockerfile or Containerfile in the build context directory to define the container image layers and instructions. Podman follows the OCI (Open Container Initiative) image specification and uses the Dockerfile format by default, making option C the only correct choice for building an image.
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-compose.yml
Why it's wrong here
docker-compose.yml is a Compose specification file that orchestrates multi-container applications by declaring services, networks, and volumes. It is consumed by docker-compose or podman-compose, not by podman build, which directly builds images from a Dockerfile or Containerfile. A compose file may reference a build context via the 'build:' key, but that context still must contain the actual Dockerfile/Containerfile.
- ✗
container.json
Why it's wrong here
container.json is not a recognized file in the container build process. While podman does store runtime metadata in storage directories, there is no standard JSON file that defines build steps or base images for podman build. The only primary build file expected is the Dockerfile or Containerfile, which contains the instructions to assemble the container image.
- ✓
Dockerfile (or Containerfile)
Why this is correct
Dockerfile (or Containerfile) is the conventional build file that podman build reads by default to assemble an image, containing instructions such as FROM, RUN, and COPY. Podman automatically looks for Dockerfile and, if not found, falls back to Containerfile, which uses the same syntax and is tool-agnostic. A directory with one of these files is the minimal requirement to start a build.
- ✗
.dockerignore
Why it's wrong here
.dockerignore is an optional file that tells podman which files in the build context to exclude before sending the context to the builder, reducing size and preventing secrets from being copied. It does not contain build steps, so its presence alone cannot produce an image. The required file is the Dockerfile/Containerfile; .dockerignore merely augments the build by filtering what gets included in the context.
Go deeper
Related to this question
About these practice questions
This EX200 question is part of Courseiva's 427-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 EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.