找不到run_web.sh,即使它在dir中也没有找到?

问题描述 投票:1回答:1

我刚安装了Docker,在设置了Python,Django等等之后,我的web服务器运行之前就出错了。

为了让Web服务器运行,我编写了一个名为run_web.sh的脚本。它还在docker-compose.yml中配置运行web服务器,运行命令exec run_web.sh。执行该命令时,它会抛出一个错误,如下所示:

Starting portalapi_web_1 ... error

ERROR: for portalapi_web_1  Cannot start service web: oci runtime error: container_linux.go:265: starting container process caused "exec: \"./run_web.sh\": stat ./run_web.sh: no such file or directory"


ERROR: for web  Cannot start service web: oci runtime error: container_linux.go:265: starting container process caused "exec: \"./run_web.sh\": stat ./run_web.sh: no such file or directory"

ERROR: Encountered errors while bringing up the project.

run_web.sh文件在我的项目的根目录中与docker-compose.yml相同,它无法找到它。不知道是什么问题。

即使我从我的根目录运行exec run_web.sh,仍然会收到错误:Not Found

enter image description here

python bash postgresql docker docker-compose
1个回答
1
投票

如果您的ENTRYPOINT是默认值(/bin/sh -c),您可以使用docker image inspect <yourImage>查看,那么请尝试简单地作为CMD

/full/path/of/run_web.sh

这样,您可以直接引用要启动的内容。

© www.soinside.com 2019 - 2024. All rights reserved.