Interview Prep/Docker/Build failures and cache problems

Build works locally but fails in CI with `exec format error` in a `RUN` step.

IntermediateTroubleshootingBuild failures and cache problems
Answer

Likely causes → Architecture mismatch (arm64 base layers on amd64 runner or vice versa), or QEMU binfmt not registered for cross-platform builds.

Diagnose →

docker image inspect base --format '{{.Architecture}}'
uname -m
docker buildx ls

Fix → Specify --platform, install QEMU: docker run --privileged --rm tonistiigi/binfmt --install all.

Prevent → Build multi-arch explicitly and test on both arches.

All Docker questions Roadmap: Docker & containers

More on Build failures and cache problems