EX188 Practice Questions
Prepare for EX188 with more than an answer.
- Exam fee
- $500 USD
- Time limit
- 150 minutes
- Questions on the exam
- N/A - performance-based tasks on live systems
- Passing score
- 210/300
- Level
- Specialist
- Valid for
- 3 years
Domains covered on the exam 5
- Implement Images Using Podman and Containerfile30%
- Manage Images20%
- Run Containers Locally Using Podman25%
- Run Multi-Container Applications with Podman15%
- Troubleshoot Containerized Applications10%
- 1
You are instructing a new hire on Containerfile best practices. You want to set the working directory for all subsequent instructions to
/app. Which instruction is the correct and most efficient way to do this?Show answer details
Correct answer: D
WORKDIRis the dedicated instruction to change the working directory for all subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions. UnlikeRUN cd /app, which only affects that single layer,WORKDIRpersists state change. - 2
Which of the following Containerfile instructions is triggered ONLY when the image being built is used as the base image for another build?
Show answer details
Correct answer: C
The
ONBUILDinstruction adds to the image a trigger instruction to be executed at a later time, when the image is used as the base for another build. - 3
True or False: In a Rootless Podman environment, the
USERinstruction in a Containerfile can switch to any user ID (UID) on the host system without additional configuration.Show answer details
Correct answer: B
False. In rootless mode, Podman uses user namespaces to map the user inside the container to the user outside. You are limited to the subuids and subgids allocated to your user in
/etc/subuidand/etc/subgid. You cannot arbitrarily switch to any host UID. - 4
You are a Cloud Architect designing a containerized application build process for a financial institution. You need to create a
Containerfilethat compiles a Go application from source and then packages the binary into a minimal runtime image to reduce the attack surface and image size. The build requires several dependencies that are not needed in production. Which strategy should you implement to satisfy these requirements?Show answer details
Correct answer: C
Multi-stage builds allow you to use a heavy image with compilers for the build phase and copy only the necessary artifacts (the binary) to a separate, minimal runtime image. This significantly reduces the final image size and removes build tools that could be security risks.
- 5
A DevOps engineer is optimizing a Containerfile for a Python application. The application source code changes frequently, but the dependencies (requirements.txt) change rarely. The current Containerfile rebuilds all dependencies every time the code changes. How should the engineer restructure the Containerfile to maximize build cache efficiency?
flowchart TD Start([Start Build]) --> Layer1[Base Image] Layer1 --> Layer2[Install Sys Deps] Layer2 --> Layer3[?] Layer3 --> Layer4[?] Layer4 --> Layer5[CMD Run App]Show answer details
Correct answer: B
By copying only the requirements file first and installing dependencies, Podman can cache the
RUN pip installlayer. Ifrequirements.txthasn't changed, this cached layer is reused even if the source code (copied in a later step) has changed. - 6
You are writing a Containerfile for a web server that must not run as the root user for security compliance. You have created a user named
webuserwith ID 1001. Which instruction sequence correctly configures the container to run as this user?Show answer details
Correct answer: A
The
RUNinstruction executes the command to create the user in the build phase. TheUSERinstruction then switches the context so that all subsequent instructions (like CMD or ENTRYPOINT) and the running container itself execute aswebuser.
