BM: Baca dalam Bahasa Melayu
World D2: Recipes
amd64 or arm64? buildx
You will learn: why a pack can fail on another CPU, and how buildx bakes for two at once.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Aina baked the pack on her Mac with an Apple chip. The server has an Intel chip. It stops at once. Real error: exec format error. Plain words: cooked for another kind of CPU.
Try it
Every image is built for one platform: The OS and CPU type an image is built for, like linux/amd64 or linux/arm64.: an OS plus a CPU type. Which CPU does each machine have?
Drag a card into a box. Or tap the card, then tap the box.
Watch
buildx bakes for two platforms in one go. Each step runs twice, once per CPU. Both packs share one name.
Try it
Build the command that bakes hello:1.0 for both CPU families.
Tap the pieces in the right order.
Predict
hello:1.0 now has two packs inside. A Raspberry Pi pulls it. What does it get?
Pick one answer.
Check
docker images --tree shows one name with two packs inside. That list is called an image index.
Try it
Your practice laptop is amd64. Build for it on purpose as hello:amd64, then run it.
Your laptop~/hello
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- alpine:3.221 layers · 12.9MB
0 containers (0 running), 1 images, 0 lockers.
You did it!
You can now build images for amd64 and arm64.
Go deeper (optional)
To run steps for another CPU, Docker can use an emulator called QEMU. It is slow, so big teams often build each platform on its own machine.
Where the story breaks: a cook gets the same cake from the same recipe. A Dockerfile may not. RUN apk add curl can fetch a newer curl next month. Pin versions to keep the taste.
Real mission
docker version --format "{{.Server.Arch}}"docker buildx build --platform linux/amd64,linux/arm64 -t hello:1.0 .docker images --tree hello
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Aina bakar pek itu di Mac yang guna cip Apple. Server pula guna cip Intel. Ia terus berhenti. Ralat sebenar: exec format error. Maksudnya: dimasak untuk jenis CPU lain.
Setiap image dibina untuk satu platform: satu OS dan satu jenis CPU. CPU mana yang ada pada setiap mesin?
buildx bakar untuk dua platform sekali gus. Setiap langkah jalan dua kali, sekali untuk setiap CPU. Kedua-dua pek kongsi satu nama.
Bina arahan yang bakar hello:1.0 untuk kedua-dua keluarga CPU.
hello:1.0 kini ada dua pek di dalamnya. Sebuah Raspberry Pi pull image itu. Apa yang ia dapat?
docker images --tree tunjuk satu nama dengan dua pek di dalam. Senarai itu dipanggil image index.
Laptop latihan anda amd64. Bina untuknya dengan sengaja sebagai hello:amd64, kemudian jalankan.
Kini anda boleh bina image untuk amd64 dan arm64.
You finished this before. Practice is always welcome!
Official docs: Docker docs: Multi-platform builds · docker buildx build · docker image ls (--tree)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?