Skip to content
Back to the playbook

Fixing 'exec format error' in a container

DockerDocker Buildx / BuildKitrevision 1

Diagnostic tree

  1. In progressContainer fails with exec format errorThis is the kernel refusing to execute a binary it doesn't understand — usually because the binary was compiled for a different CPU architecture than the host it's running on.
View the whole map (7 more steps)
  • Check the image's architecture against the host's
  • Fix: build a multi-architecture image
  • Confirm the image now runs on the target host
  • Resolved
  • Is the thing actually failing a script rather than a compiled binary?
  • Root cause: missing or corrupted shebang line
  • Neither architecture nor shebang explains it

What to test

Container fails with exec format error

This is the kernel refusing to execute a binary it doesn't understand — usually because the binary was compiled for a different CPU architecture than the host it's running on.

What happened?