BM: Baca dalam Bahasa Melayu
World D2: Recipes
Choose a base image
You will learn: how alpine, slim, distroless and hardened bases change size and safety.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Your laptop~/diary
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB
- nginx:latest7 layers · 243MB
0 containers (0 running), 2 images, 0 lockers.
Same page, same recipe, two bases. One pack is more than twice as big. Which base would you ship?
Watch
Tap each point on the timeline.
The base image: The ready-made pack your recipe starts from. It is the FROM line. is the FROM line: the pack you start from. Tap each one, from biggest to smallest.
Try it
Shrink the API’s meal pack below 200MB. Swap the base and try a build stage.
Shrink the meal pack under 200MB. Every button is a real trick.
Image size 1.36GB
Target: 200MBStart: 1.36GB
Base image
Recipe tricks
Dockerfile
FROM node:24 WORKDIR /app COPY . . RUN npm ci RUN npm run build CMD ["node", "dist/server.js"]
Predict
You ship on distroless: A base with only what the app needs to run. No shell, no package manager.. Then you type docker exec -it api sh to look around. What happens?
Pick one answer.
Check
Real error: executable file not found in $PATH. Plain words: there is no sh in this pack. That is the point.
Check
Which base fits?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now pick a base by size, tools and safety.
Go deeper (optional)
Docker Hardened Images live at dhi.io. Log in with your free Docker account, then pull, like dhi.io/python:3.13. They come with an SBOM and signed provenance (World D5). Distroless and hardened bases pair well with a build stage.
Real mission
docker pull node:24-alpinedocker images
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Laman sama, resepi sama, dua asas. Satu pek lebih dua kali ganda besar. Asas mana yang anda nak hantar?
Image asas ialah baris FROM: pek yang anda mula guna. Ketik setiap satu, dari yang paling besar ke paling kecil.
Kecilkan pek makanan API bawah 200MB. Tukar asas dan cuba peringkat build.
Anda hantar atas distroless. Kemudian anda taip docker exec -it api sh untuk tengok-tengok. Apa jadi?
Ralat sebenar: executable file not found in $PATH. Maksudnya: tiada sh dalam pek ini. Memang itu tujuannya.
Asas mana yang sesuai?
Kini anda boleh pilih asas ikut saiz, alat dan keselamatan.
You finished this before. Practice is always welcome!
Official docs: Docker docs: Best practices (choose the right base image) · Docker docs: Base images · Docker Hardened Images · Docker Hardened Images: get started
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?