What this thread does
Do first: build with docker buildx build --platform linux/amd64 for an x86-64 Linux host, then inspect the resulting image and its actual entrypoint.
Short answer
As of November 2026, use current Docker multi-platform and CLI docs. exec format error can mean a CPU mismatch. (multi-platform builds) (BuildKit troubleshooting)
Choose / don't choose
- One x86-64 deployment: choose
linux/amd64even when building on ARM; don't silently accept the workstation's default platform. - Several CPU targets: publish matching variants under a multi-platform manifest; don't relabel one architecture's executable as another.
- Compilation/compression-heavy builds: choose native nodes for each target, or supported cross-compilation; QEMU is convenient but can be much slower (strategy guide).
Not for: Desktop startup and CRI probe failures; see execsync-deadlineexceeded-docker-jfs-exec-format-runtime-errors.
Settings that matter
| Setting or flag | Value / condition | Applies to | Source |
|---|---|---|---|
docker buildx build --platform | linux/amd64 for x86-64 Linux; linux/amd64,linux/arm64 for both variants | Current Buildx | build CLI |
docker run --platform | linux/amd64 selects that variant; foreign CPU execution still needs emulation | Current Docker run | run CLI, platform guide |
--load / --push | Load a single-target local result or publish to the intended registry; multi-platform storage depends on image-store/builder support | Current Buildx exporters | build CLI |
docker buildx imagetools inspect | Inspect the exact registry reference/digest and listed platform manifests | Current Buildx | inspection CLI |
docker buildx create --append | Add the other native architecture node to an existing named builder | Current multi-node Buildx | strategy guide |
Order of operations
1. Inspect the base image with docker buildx imagetools inspect BASE_IMAGE and require the deployment platform. Buildx's selected platform determines base-image selection and build execution; precompiled artifacts copied from the host still need the correct CPU (build CLI, BuildKit errors). 2. Rebuild all native artifacts for the target. Choose a compiler that supports the target or use a native builder (strategies). 3. Inspect the published app reference with docker buildx imagetools inspect IMAGE; inspect local metadata and entrypoint using docker image inspect IMAGE. Compare architecture and executable contents, rather than inferring compatibility solely from an image tag (registry, local inspection). 4. If the image platform matches but startup still fails, inspect the script's first bytes, shebang, Unix line endings, interpreter presence and executable permission. Treat line endings and interpreter declarations as a separate diagnostic branch. Correct the source script and rebuild (line-ending report, Dockerfile entrypoint). 5. Run the intended variant on its target CPU; docker run --platform linux/amd64 IMAGE expresses selection. On an ARM host, success depends on configured emulation, so native deployment validation remains necessary (run, multi-platform guide).
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
exec format error | Unsupported CPU binary, mixed-architecture contents, or missing foreign-architecture emulation | Rebuild for the target; inspect all artifacts; use documented emulation only when foreign execution is intended | BuildKit troubleshooting, Nima, September 22, 2025 |
exec format error | Reported entrypoint script's line endings | Normalize to Unix line endings and a valid shebang pointing to an interpreter included in the image | sylvainmouquet, May 3, 2016, entrypoint reference |
Nima's September 2025 report concerns builder-image architecture selection, illustrating that the failing executable can belong to the builder itself, not the application.
Missing
- No universal fixed Docker release applies: image CPU, copied binaries, script format and emulation are separate causes.
- Actual base digest, application binaries, ABI and target kernel are unspecified; manifest inspection alone cannot establish compatibility.
Checked
2026-11-12; current docs, November 2026. Docker platform/build/run/image references, BuildKit troubleshooting, dated Nima discussion and Moby script-format report read. No builds, containers or image publication executed.
Started from a post by @Docker documentation team, packaged by the editor. Original post