BM: Baca dalam Bahasa Melayu
World D2: Recipes
Tags with SemVer, Git SHA and labels
You will learn: to name every image so anyone can tell exactly what is inside.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
The live site runs diary:latest. It breaks at lunch. Which version is it?
Pick one answer.
Watch
Your laptop~/diary
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB
0 containers (0 running), 1 images, 0 lockers.
One pack, two stickers. 1.2.0 is a Semantic Versioning (SemVer): Version numbers in three parts: MAJOR.MINOR.PATCH. tag for people. sha-3f2a9c1 names the exact Git commit. Same ID: nothing was copied.
Predict
SemVer is MAJOR.MINOR.PATCH. You fix a typo on the diary page. What does 1.2.0 become?
Pick one answer.
Try it
Build the command for version 1.2.1. Tag it with your commit’s short id too.
Tap the pieces in the right order.
Hint
git rev-parse --short HEAD prints your current commit’s short id.Try it
Now for real. Build diary with two tags: 1.2.0 and sha-3f2a9c1.
Your laptop~/diary
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB
0 containers (0 running), 1 images, 0 lockers.
Watch
Your laptop~/diary
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB
0 containers (0 running), 1 images, 0 lockers.
A label: A sticker on the pack with a fact, like its version or source code link. is a fact stuck on the pack. The standard names start with org.opencontainers.image., like title, version and source. docker inspect reads them.
Check
Would you run this tag on the live site?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now tag and label images clearly.
Go deeper (optional)
docker tag diary:1.2.0 diary:1.2 adds a third sticker that you can move to 1.2.1 later. In World C2, a pipeline makes these tags for you. Labels from --label and LABEL end up in the same list.
Real mission
git rev-parse --short HEADdocker images
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Laman yang hidup jalankan diary:latest. Ia rosak waktu makan tengah hari. Versi mana itu?
Satu pek, dua pelekat. 1.2.0 ialah tag SemVer untuk manusia. sha-3f2a9c1 namakan commit Git yang tepat. ID sama: tiada apa disalin.
SemVer ialah MAJOR.MINOR.PATCH. Anda baiki salah ejaan di laman diari. 1.2.0 jadi apa?
Bina arahan untuk versi 1.2.1. Tag juga dengan id pendek commit anda.
git rev-parse --short HEAD cetak id pendek commit semasa anda.Sekarang betul-betul. Bina diary dengan dua tag: 1.2.0 dan sha-3f2a9c1.
Label ialah fakta yang dilekat pada pek. Nama piawai bermula dengan org.opencontainers.image., contohnya title, version dan source. docker inspect membacanya.
Mahukah anda jalankan tag ini di laman yang hidup?
Kini anda boleh tag dan label image dengan jelas.
You finished this before. Practice is always welcome!
Official docs: docker image tag · Dockerfile reference: LABEL · OCI image annotations (standard label names) · Semantic Versioning
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?