Multi-architecture Docker tutorial showing how to compile a tiny C Hello World, build linux/amd64 and linux/arm64 container images with buildah, create a manifest list, and push a multi-arch image. Great companion lab for Python/Go students learning containers and Apple Silicon / cloud ARM.
Cross-track lab (Containers) linked from the Python and Cloud paths · Time: ~45–90 minutes · Level: intermediate beginner
| Piece | Role |
|---|---|
hello.c |
Static-friendly Hello World in C |
Dockerfile |
Container build definition |
| README commands | buildah multi-arch + manifest workflow |
SEO keywords: multi arch docker tutorial, buildah multi-architecture image, docker manifest amd64 arm64, static binary container hello world, build multi-platform container from scratch.
- Linux host (or VM) with buildah (and typically podman)
gccfor local static build experiments- Container registry account if you push (Docker Hub, Quay, etc.)
- Basic Docker/Podman knowledge
git clone https://github.com/saurabhahuja71/hello.git
cd hello
gcc -static -o hello hello.c
./hello
# Hello, World!Static linking helps minimal/scratch-style images.
Adjust image names to your registry namespace.
# Build per-architecture images (example tags)
buildah build --platform linux/amd64 -t docker.io/YOURUSER/hello:v1.0-amd64 .
buildah build --platform linux/arm64 -t docker.io/YOURUSER/hello:v1.0-arm64 .
buildah inspect docker.io/YOURUSER/hello:v1.0-arm64
# Create and fill a manifest list
buildah manifest create docker.io/YOURUSER/hello:v1.0
buildah manifest add docker.io/YOURUSER/hello:v1.0 docker.io/YOURUSER/hello:v1.0-amd64
buildah manifest add docker.io/YOURUSER/hello:v1.0 docker.io/YOURUSER/hello:v1.0-arm64
buildah manifest inspect docker.io/YOURUSER/hello:v1.0
# Push all architectures
buildah manifest push --all docker.io/YOURUSER/hello:v1.0 \
"docker://docker.io/YOURUSER/hello:v1.0"Original sample commands used
docker.io/sauraahu/hello:…as an example remote — replace with your account.
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 \
-t docker.io/YOURUSER/hello:v1.0 --push .- Why multi-arch images matter (Intel laptops vs Graviton/Raspberry Pi)
- Difference between a single-arch tag and a manifest list
- Static binaries vs distro-heavy images
- Registry push workflows for portable demos
- Change the message in
hello.c, rebuild both arches, re-push. - Run the arm64 image on an arm64 host (or emulator) and amd64 on x86.
- Rewrite the Dockerfile as multi-stage: build with gcc, run on
scratchoralpine. - Add a GitHub Actions workflow with
docker/build-push-actionmatrices. - Compare image sizes: static C vs
python:slim“hello”.
| Track | Related labs |
|---|---|
| Containers / K8s | react-fastapi-todo Compose · helidon-cloudnative-microservice-sample |
| Python apps | Ship FastAPI/Flask images using the same multi-arch ideas |
| Hub | learning-path |
Do I need two physical machines?
No. buildah/buildx can cross-build; you still should test on real hardware when possible.
buildah vs docker build?
Both can produce OCI images. buildah is common on Podman/RHEL-style setups.
Is C required for Python students?
Only for this tiny demo. The manifest skill transfers to any language image.
docker buildah multi-arch arm64 amd64 containers oci manifest-list tutorial devops hello-world c
Educational sample.