Practice EX188 Container Image Building questions with full explanations on every answer.
Start practicing
Container Image Building — choose a session length
Free · No account required
Click any question to see the full explanation and answer options, or start a focused practice session above.
When writing a Containerfile, which instruction specifies the base image to be used for the subsequent build steps?
2Which instruction documents the network ports on which a container listens at runtime?
3A 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?
4You 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?
5Which instruction should be used in a Containerfile to copy local files from the host machine into the container filesystem?
6Which Containerfile instruction sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions?
7Which user instruction changes the user name or UID and group name or GID to use when running subsequent instructions in the Containerfile?
8A container image needs to automatically extract a local tar archive file named 'app.tar.gz' into the destination directory '/opt/app' during the build process. Which instruction should be used?
9You are troubleshooting a build where a RUN instruction fails because it cannot reach a remote URL to download a file. The local network uses an HTTP proxy. How should you pass the proxy settings to the build command without hardcoding them into the image?
10You 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?
11An administrator needs to execute multiple commands in a single RUN instruction to minimize image layers. Which syntax is standard in a Containerfile?
12You are writing a Containerfile and need to ensure that the default command executed when the container starts can be easily overridden by passing arguments on the podman run command line. Which instruction should you use?
13You want to create a rigid container image where the container always executes a specific binary (/usr/bin/redis-server) and any arguments passed to 'podman run' are appended as arguments to that binary. Which instruction combination is best?
14You 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?
15A 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?
16What is the primary benefit of utilizing multi-stage builds in Containerfiles?
17An auditor notices that a container image runs its main application process as the 'root' user by default. Which Containerfile instruction can be added to ensure the container runs as a non-privileged user named 'appuser'?
18When writing a Containerfile, what is the difference between shell form and exec form for the CMD instruction?
19You 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?
20A 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?
21You 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?
22You need to label your container image with maintainer details and version metadata according to OCI annotation standards. Which instruction should you use?
23You want to ensure that if any command in a multi-command RUN instruction fails, the entire container build process fails immediately. What shell option should be set or is default in Containerfiles?
24When using the ADD instruction with a remote URL source, what is a recommended best practice regarding security and layer efficiency?
25How does Podman's rootless build architecture handle volume mounts or privileged operations specified within a RUN instruction in a Containerfile?
26You 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?
27A 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?
28You 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?
29When creating multi-architecture container images using podman build, how can you ensure that architecture-specific binaries are correctly handled when using instructions like COPY?
30Which TWO instructions in a Containerfile can be used to set metadata or default execution parameters that influence how a container runs? (Choose two.)
31You 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?
32Which TWO Containerfile instructions are used to bring files or data from outside the container into the build context or image? (Choose two.)
33Which TWO commands can be used with Podman to build a container image from a Containerfile? (Choose two.)
34Which TWO options are valid flags for the 'podman build' command to specify build arguments and tags? (Choose two.)
35Which TWO statements are true regarding the EXPOSE instruction in a Containerfile? (Choose two.)
36Which TWO instructions are used to define variables or set environment values within a Containerfile? (Choose two.)
37Which THREE practices should be followed to optimize container image size and build caching when writing Containerfiles? (Choose three.)
38Which THREE mechanisms are valid ways to pass build arguments into a Containerfile during a 'podman build' invocation? (Choose three.)
39Which THREE statements are correct regarding the behavior and usage of the WORKDIR instruction? (Choose three.)
40Which THREE features or characteristics distinguish the ADD instruction from the COPY instruction in a Containerfile? (Choose three.)
41Which THREE statements are true concerning how Podman builds container images and utilizes the build context? (Choose three.)
42Which THREE directives or practices are associated with implementing secure container builds and adhering to least-privilege principles? (Choose three.)
43Which THREE behaviors occur when utilizing multi-stage builds in a Containerfile? (Choose three.)
44Which THREE conditions or practices can cause layer cache invalidation during a 'podman build' operation? (Choose three.)
45Which THREE statements accurately describe the differences between shell form and exec form for CMD and ENTRYPOINT instructions? (Choose three.)
46Which THREE advanced configuration steps or flags are available when performing rootless builds or utilizing buildah/podman build advanced features? (Choose three.)
47Which THREE practices should be observed when managing environment variables (ENV vs ARG) in Containerfiles for secure and efficient builds? (Choose three.)
48You 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?
49An 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?
50You 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?
51By 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?
52You 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?
53You 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?
54You 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?
55An auditor reviewing your Containerfile notices an EXPOSE instruction for port 80. What is the primary function of the EXPOSE instruction?
56You are optimizing a Containerfile using multi-stage builds to minimize image size. What is the key advantage of a multi-stage build in Podman?
57Which TWO of the following instructions in a Containerfile can be written using either the shell form or the exec form?
58Which THREE practices are recommended when optimizing cache utilization during image builds with podman build?
59Which TWO instructions can be used to copy files or directories from a build context into a container image?
60Which THREE statements correctly describe the differences between CMD and ENTRYPOINT in a Containerfile?
The Container Image Building domain covers the key concepts tested in this area of the EX188 exam blueprint published by Red Hat. Courseiva provides free domain-focused practice, mock exams, missed-question review, and readiness tracking across all EX188 domains — no account required.
The Courseiva EX188 question bank contains 60 questions in the Container Image Building domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Container Image Building domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included