Cloud Run: exec format error — image built for the wrong CPU architecture (arm64 vs amd64)

The container crashes immediately because the binary was built for ARM but Cloud Run runs amd64 (or vice versa).

Exact message you may see exec format errorstandard_init_linux.go: exec user process caused: exec format errorexec /usr/local/bin/app: exec format errorexec user process caused "exec format error"image platform linux/arm64 does not match
Seen on: Google Cloud Docker

Meaning

Building on an Apple Silicon Mac produces arm64 images. Build for the target platform: docker buildx build --platform linux/amd64 ... or gcloud builds submit, which builds amd64 by default.

Common causes

  • Image built on an M1/M2/M3 Mac without --platform
  • Multi-arch image missing the amd64 variant
  • Base image tag for another architecture
  • Prebuilt binary for the wrong arch
  • CI runner architecture mismatch

⚡ Quick fix

  1. docker buildx build --platform linux/amd64 -t IMAGE --push .
  2. Use Cloud Build for deployment builds
  3. Check with docker inspect IMAGE --format '{{.Architecture}}'

Detailed fix by platform

Shell

  1. docker buildx build --platform linux/amd64 -t REGION-docker.pkg.dev/PROJECT/repo/app:1 --push .

How to diagnose

  1. Image arch — amd64?
  2. Built on — Apple Silicon?
  3. Platform flag — Used?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Artifact Registry: Permission artifactregistry.repositories.uploadArtifacts denied — Docker push: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/p/locations/l/repositories/r" (Google Cloud / Firebase)Artifact Registry: Pe…Cloud Build: step exited with non-zero status — Cloud Build: ERROR: build step 2 "gcr.io/cloud-builders/npm" failed: step exited with non-zero status: 1 (Google Cloud / Firebase)Cloud Build: step exi…Cloud Run 403: Your client does not have permission to get URL — Cloud Run: Error: Forbidden — Your client does not have permission to get URL / from this server (Google Cloud / Firebase)Cloud Run 403: Your c…Cloud Run 503: The request failed because the instance had an error — Cloud Run: 503 Service Unavailable — The request was aborted because there was no available instance (Google Cloud / Firebase)Cloud Run 503: The re…Cloud Run: Image not found / failed to pull — Cloud Run: Revision 'svc-00005' is not ready — Image 'gcr.io/proj/app:latest' not found / Permission 'artifactregistry.repositories.downloadArtifacts' denied (Google Cloud / Firebase)Cloud Run: Image not …exit(1) — Cloud Run: Container called exit(1) — the revision failed to start (Google Cloud / Firebase)exit(1)gcr.io — Artifact Registry: Repository not found / gcr.io image push fails after Container Registry shutdown (Google Cloud / Firebase)gcr.iostartup probe — Cloud Run: Startup probe failed — revision not ready (container didn't become healthy in time) (Google Cloud / Firebase)startup probeexec form…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.