Python 未找到run#web.sh,即使它是';迪尔有什么?
我刚刚安装了Docker,在设置了Python、Django等一些东西之后,在我的web服务器开始运行之前,我遇到了一个错误 为了让web服务器运行,我编写了一个名为Python 未找到run#web.sh,即使它是';迪尔有什么?,python,bash,postgresql,docker,docker-compose,Python,Bash,Postgresql,Docker,Docker Compose,我刚刚安装了Docker,在设置了Python、Django等一些东西之后,在我的web服务器开始运行之前,我遇到了一个错误 为了让web服务器运行,我编写了一个名为run\u web.sh的脚本。它还配置在docker compose.yml中,要运行web服务器,请运行命令exec run\u web.sh。执行该命令时,它会抛出一个错误,如下所示: Starting portalapi_web_1 ... error ERROR: for portalapi_web_1 Cannot
run\u web.sh
的脚本。它还配置在docker compose.yml
中,要运行web服务器,请运行命令exec run\u 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
,仍然会收到错误:未找到
如果您的
入口点是默认的(/bin/sh-c
),您可以使用docker图像检查检查,然后简单地作为命令尝试:
/full/path/of/run_web.sh
这样,您就可以直接引用要启动的内容。在bash的当前目录中运行文件的正确语法是/run\u web.sh
。bash中不应该有任何exec
。