How containers are built and run with Docker, and how Kubernetes schedules, connects and heals them. Written for engineers who deploy and debug containerised apps.
You’re reading a free preview. Sign up to see every topic and question — and to play this deck as games.
The Dockerfile instructions, how the build cache works, and how to build images that are small, fast to rebuild and do not run as root.
41 total questions
Card #1
FROM
Card #2
RUN
Card #3
COPY
1. In a Node.js Dockerfile, COPY . . comes before RUN npm ci, and every code change reinstalls all the dependencies. What fixes it?
2. A Dockerfile has RUN apt-get update on one line and RUN apt-get install -y curl on the next. Months later, a package you add to the install line fails to download. Why?
3. One RUN step downloads a 300 MB archive and the next RUN step deletes it. How much does this add to the image?
1. To keep a secret out of every layer, BuildKit can mount it for a single step with RUN --mount=type=___.
Hint: The mount type is named after what it carries
2. RUN --mount=type=___ keeps a package manager's download folder between builds without storing it in the image.
Hint: Where downloads are kept for reuse
3. The flag COPY --___=app:app sets the owner of the copied files in the same step, so no separate layer is needed to change ownership.
Hint: The Linux command that changes a file's owner