What it means
The kernel can't run the file: it's an x86-64 binary on an ARM machine (or the reverse), or a script without a #! line. It's common since Apple silicon and Graviton servers.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The image (or a binary downloaded in it) is for a different architecture
Check:
docker image inspect <image> --format '{{.Architecture}}'
uname -m
Fix: Build for the target with docker buildx build --platform linux/amd64,linux/arm64, and download binaries per TARGETARCH.
2. An entrypoint script without a shebang, or with CRLF line endings
Check:
head -1 entrypoint.sh | od -c | head -2
Fix: Start it with #!/bin/sh and save it with LF endings.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
Open the labNo account needed for your first tries.
Related errors
- /bin/bash^M: bad interpreter: No such file or directory
The script has Windows line endings, so Linux looks for an interpreter called "bash\r".