EX188 · domain
Container Image Building
This domain covers authoring Containerfiles to build OCI images with Podman and Buildah. You are tested on choosing instructions correctly, layering and caching behavior, passing build arguments, setting runtime defaults, and keeping images small and reproducible through practical build-and-inspect tasks.
Focused practice
Practice Container Image Building questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about Container Image Building
Build working images from a Containerfile: pick the right instructions, order steps for cache reuse, pass build arguments, and set ENTRYPOINT with overridable CMD defaults. The key is understanding layer caching and keeping cleanup in the same RUN instruction that created the files.
Selecting Containerfile instructions such as FROM, RUN, COPY, ENV, ENTRYPOINT, CMD, and LABEL correctly
Using podman build with tags, build arguments, and alternate Containerfile paths
Understanding layer caching so unchanged instructions and copied files are reused
Reducing image size by cleaning package manager caches inside the same RUN step
Watch out for
Common Container Image Building exam traps
- ▸Confusing CMD and ENTRYPOINT: CMD supplies overridable default arguments, while ENTRYPOINT sets the executable that receives them
- ▸Copying the whole build context before installing dependencies, which invalidates the cache whenever any unrelated file changes
- ▸Running a package install in one RUN and cache cleanup in a later RUN, so the removed files still occupy an earlier layer
Question index
All Container Image Building questions (53)
Click any question to see the full explanation, or start a practice session above.
An administrator needs to execute multiple commands in a single RUN instruction to minimize image layers. Which syntax is standard in a Containerfile?
Medium2Which TWO commands can be used with Podman to build a container image from a Containerfile? (Choose two.)
Easy3You need to set a persistent environment variable named 'APP_PORT' with the value '8080' inside a container image via the Containerfile. Which instruction should you use?
Easy4You are building an image behind a corporate firewall that requires a custom Certificate Authority (CA) certificate to trust internal registries and repositories. How can you add this CA certificate to the build container?
Medium5You are building a minimal container image from scratch using 'FROM scratch'. Your statically compiled Go binary fails to execute when the container starts, with a 'file not found' error, even though it was successfully copied into the image. What is the most likely cause?
Hard6What is the primary benefit of utilizing multi-stage builds in Containerfiles?
Medium7Which TWO instructions can be used to copy files or directories from a build context into a container image?
Medium8Which THREE statements correctly describe the differences between CMD and ENTRYPOINT in a Containerfile?
Hard9Which TWO of the following instructions in a Containerfile can be written using either the shell form or the exec form?
Medium10You are reviewing a Containerfile for a web application. The Containerfile currently uses the shell form for its ENTRYPOINT instruction. You want to ensure that the application receives signals correctly and that arguments passed to `podman run` are properly forwarded to the application. Which TWO changes should you make? (Choose two.)
Medium11Which instruction documents the network ports on which a container listens at runtime?
Easy12Which THREE practices should be observed when managing environment variables (ENV vs ARG) in Containerfiles for secure and efficient builds? (Choose three.)
Hard13Which THREE directives or practices are associated with implementing secure container builds and adhering to least-privilege principles? (Choose three.)
Medium14You are optimizing a Containerfile using multi-stage builds to minimize image size. What is the key advantage of a multi-stage build in Podman?
Hard15When using the ADD instruction with a remote URL source, what is a recommended best practice regarding security and layer efficiency?
Hard16You want to set the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions that follow it in the Containerfile. Which instruction achieves this?
Easy17You need to ensure that a container image built with Podman includes reproducible timestamps for files to improve security and supply chain verification. Which flag or environment variable controls this?
Hard18Which THREE behaviors occur when utilizing multi-stage builds in a Containerfile? (Choose three.)
Hard19Which TWO instructions are used to define variables or set environment values within a Containerfile? (Choose two.)
Easy20You are writing a Containerfile to build a custom application image using podman build. Which instruction should you use as the mandatory first non-comment instruction to define the base image?
Easy21You need to define a persistent environment variable named 'PORT' with the value '8080' that is available during both the build process and when running containers from the resulting image. Which instruction should you use?
Easy22Which instruction should be used in a Containerfile to copy local files from the host machine into the container filesystem?
Easy23A developer builds a custom image with `podman build -t app:v1 .` but repeatedly gets stale results because an earlier RUN layer that installs packages is cached, even though the repository metadata has changed. The developer wants to force podman to ignore all cached layers for the next build without deleting the local image or build cache. Which command accomplishes this?
Medium24Which THREE practices should be followed to optimize container image size and build caching when writing Containerfiles? (Choose three.)
Medium25You are building an image with a multi-stage Containerfile. The final stage uses `FROM registry.access.redhat.com/ubi9/ubi-minimal` and you want to copy only the compiled binary from a builder stage named `builder` into `/usr/local/bin/app`. Which Containerfile line correctly copies that artifact?
Hard26Which THREE statements accurately describe the differences between shell form and exec form for CMD and ENTRYPOINT instructions? (Choose three.)
Hard27You are using a multi-stage build in your Containerfile. How do you copy a compiled binary named 'app' from a build stage named 'builder' into your final production runtime stage?
Medium28You are optimizing a Containerfile for a Python application. The build currently uses a single RUN instruction that installs dependencies, runs tests, and cleans up temporary files. You want to leverage build caching to speed up rebuilds when only application code changes, while ensuring that dependency installation is cached separately. Which approach best achieves this?
Hard29Which TWO Containerfile instructions are used to bring files or data from outside the container into the build context or image? (Choose two.)
Easy30You are designing a container image that runs an executable web server. You want to provide default arguments to the executable that can be easily overridden by a user passing arguments directly to 'podman run'. Which instruction combination is best?
Hard31Which Containerfile instruction sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions?
Easy32Which user instruction changes the user name or UID and group name or GID to use when running subsequent instructions in the Containerfile?
Easy33By default, podman build executes build instructions using the root user. You want to switch the execution context to a non-privileged user named 'appuser' for all subsequent RUN, CMD, and ENTRYPOINT instructions. Which instruction should you use?
Medium34Which THREE features or characteristics distinguish the ADD instruction from the COPY instruction in a Containerfile? (Choose three.)
Medium35Which TWO statements are true regarding the EXPOSE instruction in a Containerfile? (Choose two.)
Easy36You are writing a Containerfile for a Python web service. You want the image build to install dependencies and then run the service with predictable behavior across environments. Which TWO practices correctly apply build-time and runtime configuration in the Containerfile? (Choose two.)
Hard37How does Podman's rootless build architecture handle volume mounts or privileged operations specified within a RUN instruction in a Containerfile?
Hard38Which TWO instructions in a Containerfile can be used to set metadata or default execution parameters that influence how a container runs? (Choose two.)
Easy39When writing a Containerfile, which instruction specifies the base image to be used for the subsequent build steps?
Easy40A developer wants to build a container image using podman build, but the Containerfile is named 'Customfile' and located in a subdirectory named 'dockerfiles'. Which command accomplishes this?
Easy41You are optimizing image build times and notice that a specific RUN instruction fetching dependencies is re-running on every build, even though the requirements.txt file has not changed. What is causing this behavior?
Hard42An administrator needs to execute a package update and install dependencies during the podman build process, ensuring these commands are committed as a new layer in the final image. Which instruction accomplishes this?
Medium43You want to build an image that has a build-time argument named 'VERSION'. How do you declare this variable inside the Containerfile so it can be used during the build steps?
Medium44When writing a Containerfile, what is the difference between shell form and exec form for the CMD instruction?
Medium45A developer needs to optimize image size by removing build caches and temporary package manager cache files within the same RUN instruction. Why must this be done in a single RUN instruction?
Medium46Which THREE practices are recommended when optimizing cache utilization during image builds with podman build?
Hard47You need to ensure that a file copied into your image via the COPY instruction is owned by a specific user 'developer' and group 'devgroup'. How can this be achieved efficiently?
Medium48A team wants to document ownership and contact information directly in the image so that `podman inspect` shows who maintains it. Which Containerfile instruction should they add to set this metadata?
Easy49A developer has written a Containerfile with multiple COPY instructions for static configuration files that change frequently, placed near the top of the Containerfile before the application code installation. Why is this considered a bad practice for build caching?
Medium50You need to copy local application source code from your build context into the /app directory inside the container image, automatically unpacking it if it is a local tar archive. Which instruction should you select?
Hard51Which TWO options are valid flags for the 'podman build' command to specify build arguments and tags? (Choose two.)
Easy52An auditor reviewing your Containerfile notices an EXPOSE instruction for port 80. What is the primary function of the EXPOSE instruction?
Medium53A developer wants to pass a secret API key during the container build process without leaving the secret exposed in image layers or history. Which Podman feature should be used?
HardOther domains
All EX188 exam domains
Frequently asked questions
- What does the Container Image Building domain cover on the EX188 exam?
- Build working images from a Containerfile: pick the right instructions, order steps for cache reuse, pass build arguments, and set ENTRYPOINT with overridable CMD defaults. The key is understanding layer caching and keeping cleanup in the same RUN instruction that created the files.
- How many questions are in this domain?
- This page lists all 53 Container Image Building questions in the EX188 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only Container Image Building questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.