【发布时间】:2017-12-24 09:10:37
【问题描述】:
我刚刚安装了 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
【问题讨论】:
-
在 bash 中运行当前目录中的文件的正确语法是
./run_web.sh。 bash 中不应该有任何exec。
标签: python bash postgresql docker docker-compose