How to Run Multi-Architecture Docker Builds on Apple Silicon Macs (M1/M2/M3/M4)

Published by Diwakar on

How to Run Multi-Architecture Docker Builds on Apple Silicon Macs (M1/M2/M3/M4)
Spread the love

Multi-architecture Docker builds on Apple Silicon are essential for developers working with Apple’s M1, M2, and M3 chips. These chips use ARM64, while most production environments still require AMD64 images.

Whether you’re deploying to cloud runtimes, CI/CD pipelines, or x86-based Kubernetes clusters, you’ll likely need to build and push linux/amd64 images from your Apple Silicon machine.

This guide explores how to run multi-architecture Docker builds on Apple Silicon using Colima and Podman:

  1. Podman (open-source alternative with QEMU support)
  2. Docker Desktop (with cross-platform support)
  3. Colima (native AMD64 builds on a virtualized Docker host)

Step 0: Do You Even Need Colima?

If you already use Docker Desktop, you may not need anything else. BuildKit + Buildx is built-in and supports multi-architecture builds via QEMU emulation.

To check if you’re set:

docker buildx version

Then try a simple cross-platform build:

docker buildx build \
--platform linux/amd64 \
-t registry.example.com/your-app-name:latest \
. --push

This works out of the box for many users — but builds can be slow due to QEMU emulation.

Method 1: Multi-Architecture Docker Builds on Apple Silicon with Colima

Colima allows you to run a lightweight VM on your Mac that emulates x86_64, giving you native-speed Docker builds for AMD64.

Step 1: Install Required Tools

brew install docker
brew install colima
brew install lima qemu lima-additional-guestagents

Step 2: Start Colima in x86_64 Mode

colima start -p ce-amd64 --arch x86_64

-p ce-amd64: names the profile (you can create others too).

--arch x86_64: starts the VM in AMD64 mode.

Step 3: Set Docker Context

unset DOCKER_HOST
unset DOCKER_CONTEXT
docker context use colima-ce-amd64
docker --context colima-ce-amd64 ps

Confirm that you’re running under the correct architecture:

docker info | grep -i "Architecture"
#Expected: Architecture: x86_64

Step 4: Install Docker Buildx (if needed)

If you don’t have Buildx installed already (e.g., you’re using Docker CLI via Homebrew):

ARCH=$(uname -m)
VERSION=v0.26.01
curl -LO https://github.com/docker/buildx/releases/download/${VERSION}/buildx-${VERSION}.darwin-${ARCH}
mkdir -p ~/.docker/cli-plugins
mv buildx-${VERSION}.darwin-${ARCH} ~/.docker/cli-plugins/docker-buildx
chmod +x ~/.docker/cli-plugins/docker-buildx
docker buildx version

Check for latest released version of buildx here and set in VERSION above.

Step 5: Build and Push AMD64 Image

Now you’re ready to build:

docker buildx build \
--platform linux/amd64 \
-t registry.example.com/your-app-name:latest \
. --push

You can also use --load instead of --push if you want to load the image into your local Docker host.

Method 2: Using Podman with QEMU

Podman offers a Docker-compatible CLI and can run AMD64 builds using QEMU emulation.

Step 1: Enable QEMU in Podman VM

podman machine ssh sudo rpm-ostree install qemu-user-static
podman machine ssh sudo systemctl reboot

Step 2: Build and Push AMD64 Image

podman build \
--platform linux/amd64 \
-t registry.example.com/your-app-name:latest \
.
podman push registry.example.com/your-app-name:latest

Summary: Which Approach Should You Choose?

MethodBest ForProsCons
Docker DesktopMost users with standard setupNo extra tools neededSlower builds via QEMU
Colima (x86_64)Speed-focused AMD64 native buildsFast, efficient, native arch VMRequires setup + context switch
PodmanOpen-source environmentsLightweight, daemonless, CLI-onlyBuild speed limited by emulation but still faster than Colima and Docker Desktop

Some Tips:

  • You can verify image architecture using:
docker image inspect  | grep Architecture
  • Prefer native builds.
  • Use Buildx for consistency across environments, even if you’re not cross-building.