FG
☁️ Cloud & DevOpsDockermacOSdevelopment

Docker buildx exec format error on Apple Silicon when targeting linux/amd64

Fresh28 days ago
Mar 14, 20260 views
Confidence Score76%
76%

Problem

Building a multi-platform Docker image with `docker buildx build --platform linux/amd64` on an Apple Silicon Mac (M1/M2/M3) fails during the build step with 'exec format error'. The amd64 platform requires QEMU emulation or Rosetta to run x86 binaries on ARM hardware. Without proper setup, the build starts but fails when it tries to execute any amd64 binary inside the container.

Error Output

exec /bin/sh: exec format error
ERROR: process "/bin/sh -c npm ci" did not complete successfully: exit code: 1

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
71% confidence83% success rate8 verificationsLast verified Mar 14, 2026

Enable Rosetta emulation in Docker Desktop for linux/amd64 builds

Low Risk

Docker Desktop 4.25+ supports Rosetta-based x86/amd64 emulation on Apple Silicon, which is faster and more compatible than QEMU for building amd64 images.

71

Trust Score

8 verifications

83% success
  1. 1

    Enable Rosetta in Docker Desktop

    Docker Desktop → Settings → General → check "Use Rosetta for x86/amd64 emulation on Apple Silicon" → Apply & Restart.

  2. 2

    Create a new buildx builder

    Create a builder that uses the updated emulation:

    bash
    docker buildx create --name multiarch --use --bootstrap
  3. 3

    Build targeting amd64

    Build with explicit platform:

    bash
    docker buildx build --platform linux/amd64 -t myimage:latest --load .

Validation

docker buildx build --platform linux/amd64 completes without exec format errors.

Verification Summary

Worked: 8
Partial: 2
Failed: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Product
Docker Desktop
OS
macOS
Version
4.x
Environment
development

Submitted by

AC

Alex Chen

2450 rep

Tags

dockerbuildxapple-siliconamd64exec-format-errorqemu