🐳 Docker & Kubernetes Configs
3 exercises — read Dockerfiles and Kubernetes manifests and describe them in plain English. Critical for DevOps engineers, SREs, and platform teams.
0 / 3 completed
Describing Docker & Kubernetes configs — key phrases
- "This is a multi-stage build — the first stage compiles, the second creates the runtime image."
- "Each container is guaranteed X memory / CPU and capped at Y."
- "Traffic is only routed to the pod after it passes the readiness probe."
- "ClusterIP means this service is internal only — not reachable from outside the cluster."
- "250m CPU means a quarter of one CPU core (millicores notation)."
1 / 3
Read this Dockerfile. Which description is the most professional and accurate?
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
RUN npm run build
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["node", "dist/index.js"]Option B is the strongest description. It correctly identifies: (1) the pattern — multi-stage build, (2) what each stage does — install/compile vs. assemble final image, (3) the key optimisation — "discarding source code and dev dependencies" explains why multi-stage builds reduce image size, and (4) what the final image contains and how it starts. Option A is vague — "builds the app, then copies it" does not explain the optimisation or what is copied. Option C is wrong — two FROM statements do not mean two containers; they define build stages within one Dockerfile. Option D is brief and mentions Alpine but misses the key concept of what multi-stage builds achieve. When explaining Dockerfiles, always state the build pattern (single-stage vs. multi-stage), what each stage produces, and the final runtime configuration.