🔧 Error Fixes
· 2 min read
Last updated on

Docker: Multi-Platform Build Failed — How to Fix It


ERROR: multiple platforms feature is currently not supported for docker driver.
Please switch to a different driver (eg. "docker-container")

This error means you’re trying to build a multi-platform Docker image using the default builder, which doesn’t support it. The default docker driver can only build for your host architecture.

What causes this

Docker has two build systems: the legacy builder and BuildKit (via docker buildx). The default builder driver (docker) uses your local Docker daemon and can only target one platform — the one your machine runs on.

Multi-platform builds (e.g., linux/amd64 + linux/arm64) require the docker-container driver, which runs BuildKit inside a container and can cross-compile using QEMU emulation.

You’ll hit this when:

  • Running docker buildx build --platform linux/amd64,linux/arm64 with the default builder
  • Your CI pipeline tries to build for multiple architectures without setting up buildx first
  • You switched machines and the custom builder wasn’t recreated

Fix 1: Create a buildx builder

Create a new builder that uses the docker-container driver:

docker buildx create --name multiplatform --driver docker-container --use
docker buildx inspect --bootstrap

The --bootstrap flag starts the builder immediately so you can verify it works. Now build:

docker buildx build --platform linux/amd64,linux/arm64 -t myapp:latest --push .

Note: multi-platform builds must be pushed to a registry (--push). You can’t --load a multi-platform image into your local Docker daemon because it only supports one architecture at a time.

Fix 2: Build and load for a single platform

If you just need to build for a different architecture (not multiple at once), you can load it locally:

# Build for ARM on an x86 machine and load locally
docker buildx build --platform linux/arm64 -t myapp:latest --load .

This uses QEMU emulation under the hood. It’s slower than native builds but works for testing.

Fix 3: Set up QEMU for cross-platform emulation

If your builder can’t emulate other architectures, install QEMU support:

docker run --privileged --rm tonistiigi/binfmt --install all

This registers QEMU binary handlers with the kernel. You only need to run this once per machine (it persists until reboot).

Fix 4: Set up buildx in CI (GitHub Actions)

steps:
  - uses: docker/setup-qemu-action@v3
  - uses: docker/setup-buildx-action@v3
  - uses: docker/build-push-action@v5
    with:
      platforms: linux/amd64,linux/arm64
      push: true
      tags: myapp:latest

The setup-buildx-action creates a builder with the docker-container driver automatically.

How to prevent it

  • Always create a named buildx builder on new machines: docker buildx create --name mybuilder --use.
  • In CI, use the official docker/setup-buildx-action — it handles builder creation and QEMU setup.
  • If you only need one platform, skip --platform entirely. Docker defaults to your host architecture, which avoids the emulation overhead.
📘