Skip to main content

Dockerfile 指定 entrypoint 之后运行报 exec format error 错误

· One min read
Alan

Dockerfile 指定 entrypoint 脚本后, 运行提示一下错误:

standard_init_linux.go:228: exec user process caused: exec format error

这种情况尝试给 entrypoint 指定的shell脚本添加shebang:

entrypoint.sh
#!/bin/bash

code-server --config /code-server/config.yaml /app # 你的脚本内容

来源: Docker exec format error – How we sort it out?:

The shebang is always on the first line of the script, and is composed of #! Characters. So the Shebang (#!/bin/bash) should be put on the first line of the script because the first bytes were checked by kernel. So we add the shebang in the script.