Building and Publishing Multi-Platform Images
Step-by-step tutorial on building multi-platform images with docker buildx, QEMU emulation, native cross-builders, and CI/CD automation.
Published on • November 18, 2026
AI Assistant

Building container images that run seamlessly on both Intel/AMD x86 servers (amd64) and ARM-based servers like AWS Graviton or Apple Silicon (arm64) is standard practice for modern cloud-native applications.
Using Docker Buildx (powered by BuildKit), you can compile, assemble, and publish multi-platform container images in a single command.
In this step-by-step tutorial, we will configure Buildx builder instances, set up QEMU emulation, execute cross-platform builds, and integrate multi-platform builds into GitHub Actions.
Prerequisites & Architecture Overview
+-----------------------------------------------------------------------------------+
| Docker Buildx Multi-Platform Engine |
+-----------------------------------------------------------------------------------+
│
├── Target 1: `linux/amd64` (Intel/AMD) --> Built natively or via QEMU
└── Target 2: `linux/arm64` (ARM/Graviton) --> Built natively or via QEMU
│
v (BuildKit automatically stitches manifests into an OCI Index)
+-----------------------------------------------------------------------------------+
| Published OCI Manifest List Index (`myorg/myapp:v1.0.0`) |
+-----------------------------------------------------------------------------------+
Step 1: Enabling QEMU Emulation
Building for foreign architectures (e.g. building an arm64 image on an amd64 Linux build machine) requires CPU emulation. QEMU enables user-space CPU emulation for BuildKit.
Install QEMU binfmt handlers:
docker run --privileged --rm tonistiigi/binfmt --install all
Verify supported architectures:
docker buildx ls
Look for platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x.
Step 2: Creating a Custom Buildx Builder
The default default Docker builder instance does not support multi-platform outputs or container drivers. You must create a new builder backed by the container (docker-container) driver:
# 1. Create a new builder instance named 'multiarch-builder'
docker buildx create --name multiarch-builder --driver docker-container --use
# 2. Bootstrapping and verify builder startup
docker buildx inspect --bootstrap
Sample output:
Name: multiarch-builder
Driver: docker-container
Status: running
Platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le, linux/s390x
Step 3: Building & Publishing Multi-Platform Images
When building multi-platform images, BuildKit creates intermediate layers for each target architecture simultaneously. Because local Docker daemon storage historically only held single-arch images, multi-platform builds must be pushed directly to a remote registry using --push or exported via OCI tarball:
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t myregistry.com/team/web-app:v1.0.0 \
--push .
What Happens During Build:
- BuildKit spins up two parallel build pipelines: one compiling for
linux/amd64, one compiling forlinux/arm64. - Compiles layer archives for both architectures.
- Uploads layer blobs for both targets to
myregistry.com. - Creates and pushes the master OCI Manifest List pointing to both architecture manifests.
Step 4: Verification
Inspect the published tag in the registry to confirm both architecture entries are registered:
docker buildx imagetools inspect myregistry.com/team/web-app:v1.0.0
Sample Output:
Platform: linux/amd64
Platform: linux/arm64
Step 5: Automating Multi-Platform Builds in CI/CD
Using official Docker GitHub Actions to automate multi-arch releases:
name: Build Multi-Arch Docker Image
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and Push Multi-Arch Image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: myorg/web-app:${{ github.ref_name }}
Optimization Tip: Native Cross-Builders vs Emulation
QEMU emulation works well for interpreted languages (Python, Node.js), but can be slow for compiled languages (Rust, Go, C++).
For large-scale compiled projects, combine multiple native build nodes (e.g. an amd64 machine + an arm64 AWS Graviton instance) into a single remote Buildx builder pool using Docker contexts:
# Connect native arm64 node over SSH
docker context create arm64-node --docker "host=ssh://user@arm64-server.internal"
# Append native node to buildx builder
docker buildx create --name native-builder --use default
docker buildx create --name native-builder --append arm64-node
Now amd64 code compiles natively on Intel, and arm64 code compiles natively on ARM at maximum hardware speeds!
Summary
Docker Buildx streamlines multi-platform image delivery, ensuring your container applications execute natively across x86 and ARM infrastructure without code modification.