【问题标题】:run_web.sh not found even though it's there in dir?即使它在目录中也找不到run_web.sh?
【发布时间】: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


【解决方案1】:

如果您的 ENTRYPOINT 是默认值 (/bin/sh -c),您可以使用 docker image inspect <yourImage> 进行检查,然后尝试使用 CMD

/full/path/of/run_web.sh

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

【讨论】:

    猜你喜欢
    • 2018-12-21
    • 2016-02-09
    • 2011-11-20
    • 1970-01-01
    • 2014-05-16
    • 1970-01-01
    • 2019-12-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多