How to Build and Run Multi-Platform Container Images on Apple Silicon with Rosetta
Problem
My MacBook Pro runs on Apple Silicon (arm64). But the production servers where I deploy containers are x86_64 (amd64). Building on my Mac and finding out only at deployment that an image has architecture-specific bugs wastes time.
I needed a way to build multi-platform images locally and test both architectures before pushing.
How Apple container Handles Multi-Arch
Apple container’s builder VM has Rosetta 2 support enabled by default. This means the build process can translate x86_64 instructions on the fly, so I can build amd64 images on my arm64 Mac without a separate emulation setup.

Building a Multi-Platform Image
Build an image for both architectures in one command:
container build \ --arch arm64 --arch amd64 \ --tag my-image:latest \ --file Dockerfile .This produces an OCI image manifest that lists both architectures. Push it to any standard registry:
container image push registry.example.com/my-image:latestTesting Both Architectures
I can test the arm64 variant natively:
container run --arch arm64 --rm my-image uname -aOutput:
Linux 6.1.0 #1 SMP Fri Jun 12 09:50:20 CST 2026 aarch64 LinuxAnd the amd64 variant under Rosetta:
container run --arch amd64 --rm my-image uname -aOutput:
Linux 6.1.0 #1 SMP Fri Jun 12 09:50:20 CST 2026 x86_64 GNU/LinuxBoth variants come from the same image. This makes it easy to catch architecture-specific issues during local development.
Disabling Rosetta
If I want to force native-only builds and disable x86_64 emulation entirely:
[build]rosetta = falseBy default it is true, which is what most developers want.
Real Workflow
# 1. Build for both architecturescontainer build --arch arm64 --arch amd64 -t web-app:v1 .
# 2. Test arm64container run --arch arm64 --rm web-app:v1 python -c "import platform; print(platform.machine())"
# 3. Test amd64container run --arch amd64 --rm web-app:v1 python -c "import platform; print(platform.machine())"
# 4. Push the multi-arch manifestcontainer image push registry.example.com/web-app:v1
# 5. Deploy on production x86 servers — it works
Summary
In this post, I showed how to build multi-platform container images on Apple Silicon using Apple container’s built-in Rosetta support. The key point is that a single container build --arch arm64 --arch amd64 creates an OCI image that runs natively on arm64 and under Rosetta on amd64 — no separate emulation VMs needed.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments