← All fixes
Docker: exec format error (image built for the wrong CPU architecture)
#134Error
exec /usr/local/bin/docker-entrypoint.sh: exec format error
Why it happens, and why this works
The image was built for a different CPU architecture than the machine running it, typically built on an Apple Silicon Mac (arm64) and run on an amd64 server. (Also: a script entrypoint with Windows line endings or no #! line.)
Fix
Build for the target platform: docker buildx build --platform linux/amd64 -t myapp . (or set platform: linux/amd64 in compose). For both, use --platform linux/amd64,linux/arm64 with --push. If it's your own entrypoint script, make sure it starts with #!/bin/sh and has LF line endings.
Did it work?
No reports yet0 worked0 didn't
Tried it yourself?
Related fixes
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
#133Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
dockerNo reports yet
next/image: hostname is not configured under images in your next.config.js
#113Error: Invalid src prop (https://images.example.com/a.jpg) on `next/image`, hostname "images.example.com" is not configured under images in your `next.config.js`
nextjsNo reports yet
ENOENT reading a file that exists: relative path resolved from the wrong folder
#30Error: ENOENT: no such file or directory, open './data.json' (the file is right next to the script)
nodeVerifiedNo reports yet