gpt4 book ai didi

Docker Standard_init_linux.go :207: exec user process caused “no such file or directory”

转载 作者:行者123 更新时间:2023-12-05 00:45:45 26 4
gpt4 key购买 nike

我的 Dockerfile 看起来像:

FROM ubuntu:18.04

RUN apt-get ...
...
COPY app /bin

还有我的可执行文件 app只是bash脚本:
make -f /app/makefile $@

当我尝试运行时
docker run -v "`pwd`:/project" -it --rm my_image app

我收到以下错误:
standard_init_linux.go:207: exec user process caused "exec format error"
make: *** [run] Error 1

我该怎么办?

最佳答案

如果您的入口点是 bash 脚本,请检查它是否包含正确的 shebang,例如:

#!/usr/bin/env bash
make -f /app/makefile $@

在您的入口点命令中指定它,例如:
ENTRYPOINT ["sh", "/bin/app"]

关于Docker Standard_init_linux.go :207: exec user process caused “no such file or directory” ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55919623/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com