Certified Kubernetes Application Developer (CKAD) · Section 1 · 20% of the exam
Define, build and modify container images
One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Design and Build”. Here is what it covers, the points to remember and a question to try.
What it covers
Every Pod runs images, and the exam expects you to write a Dockerfile, build it with Docker or Podman, tag it, save it as an OCI archive and make a cluster use it. This lesson covers Dockerfile instructions, layer caching, multi-stage builds, how ENTRYPOINT and CMD map to a container's command and args, and image pull behaviour.
Points to remember
- ENTRYPOINT is the executable and CMD its default arguments; in a Pod,
commandreplaces ENTRYPOINT andargsreplaces CMD. - Setting only
commandalso drops the image's CMD. - Order Dockerfile steps from least to most frequently changing to use the layer cache.
- Multi-stage builds copy only artifacts with
COPY --from=<stage>into a small final image. docker build -t name:tag .builds;podman save --format oci-archive -o file.tar name:tagsaves in OCI format.
Try a question
A developer wants a value available only while the image is being built, and not inside the running container. Which Dockerfile instruction should declare it?
- A
ENV - B
ARG - C
EXPOSE - D
LABEL
Show the answer
B. ARG defines a build-time variable that is set with --build-arg and does not persist into the container's environment. ENV values are stored in the image and visible at run time.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Container Images: Define, Build and Modify teaches this objective (about 40 minutes), and 12 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.