BM: Baca dalam Bahasa Melayu
World D1: First Containers
Image vs container
You will learn: how one image (a meal pack) fills many containers (lunchboxes).
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Ali deleted the welcome page inside his lunchbox. Then he filled a fresh lunchbox from the same meal pack. The page is back! Bug or feature?
Pick one answer.
Watch
Your laptop~
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- alpine:3.221 layers · 12.9MB
- nginx:1.30-alpine8 layers · 93.5MB
0 containers (0 running), 2 images, 0 lockers.
One frozen meal pack fills two lunchboxes. The pack is the image: A frozen meal pack you can copy again and again. Containers start from it.: a template that never changes. Each container: A sealed lunchbox that holds your app and everything it needs. is one box made from it.
Try it
Sort each card. Is it about the meal pack or the lunchbox?
Drag a card into a box. Or tap the card, then tap the box.
Try it
Fill two lunchboxes from one pack. Run docker run alpine:3.22 echo hi twice. Then type docker images.
Your laptop~
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- alpine:3.221 layers · 12.9MB
- nginx:1.30-alpine8 layers · 93.5MB
0 containers (0 running), 2 images, 0 lockers.
Hint
Arrow up brings back your last command.Predict
You delete index.html inside lunch1. Then you look inside lunch2. Is index.html there?
Pick one answer.
Check
Your laptop~
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- alpine:3.221 layers · 12.9MB
- nginx:1.30-alpine8 layers · 93.5MB
0 containers (0 running), 2 images, 0 lockers.
Proof! The page left lunch1 only. lunch2 still has it. docker exec runs a command inside a box. Lesson 6 has more.
You did it!
You can now tell a meal pack (image) from a lunchbox (container).
Go deeper (optional)
A container is its image plus a thin writable layer on top. Every change goes into that layer. Remove the box, and its layer goes too. The image underneath stays untouched.
Real rep (optional):
Real mission
docker run alpine:3.22 echo hidocker ps -adocker images
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Ali padam halaman selamat datang dalam bekasnya. Kemudian dia isi bekas baru daripada pek beku yang sama. Halaman itu ada semula! Pepijat atau memang begitu?
Satu pek beku isi dua bekas. Pek itu ialah image (pek beku): templat yang tak pernah berubah. Setiap container ialah satu bekas daripadanya.
Susun setiap kad. Ia tentang pek beku atau bekas makanan?
Isi dua bekas daripada satu pek. Jalankan docker run alpine:3.22 echo hi dua kali. Kemudian taip docker images.
Anda padam index.html dalam lunch1. Kemudian anda tengok dalam lunch2. Adakah index.html di situ?
Buktinya! Halaman itu hilang dari lunch1 sahaja. lunch2 masih ada. docker exec jalankan arahan dalam bekas. Lebih lagi dalam pelajaran 6.
Kini anda boleh bezakan pek beku (image) dengan bekas makanan (container).
You finished this before. Practice is always welcome!
Official docs: What is an image? · What is a container? · docker images
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?