run_web.sh找不到,即使它在目录中吗?

我刚刚安装了Docker,在设置了Python,Django等一些东西之后,在我的Web服务器运行之前,我得到了一个错误。

为了让Web服务器运行,我写了一个名为run_web.sh的脚本。 它也在docker-compose.yml中configuration来运行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相同的项目的根目录中,因此无法find它。 不知道是什么问题。

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

在这里输入图像说明

如果您的ENTRYPOINT是缺省的( /bin/sh -c ),您可以使用docker image inspect <yourImage> ,然后尝试将其作为CMD

 /full/path/of/run_web.sh 

这样,你直接引用你想要启动的东西。