Docker 'exec format error' explained: architecture mismatch, and how to fix it
The 'exec format error' from Docker is not a bug or a broken image, but usually means the container's architecture does not match the host CPU. Running an image with --platform for a foreign architecture fails because no emulator handler is registered with binfmt_misc. The author measured that installing binfmt handlers via tonistiigi/binfmt makes the same ARM command succeed, and that removing them restores the original error. Other cases include single-architecture images built for ARM, and glibc binaries inside musl-based Alpine images, which produce a different error. The recommended fixes are publishing multi-arch images with buildx, preferring multi-arch official images, and pinning platforms in CI.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in