【问题标题】:container_linux.go:349: starting container process caused exec: flask: executable file not found in $PATHcontainer_linux.go:349:启动容器进程导致 exec:flask:$PATH 中找不到可执行文件
【发布时间】:2020-08-11 20:07:48
【问题描述】:

我在 docker 中遇到错误:

$ docker-compose -f docker-compose.yml up -d
Removing policyclassification_web_1
Recreating 9c6607f3968d_policyclassification_web_1 ... error

ERROR: for 9c6607f3968d_policyclassification_web_1  Cannot start service web: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"flask\": executable file not found in $PATH": unknown

ERROR: for web  Cannot start service web: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"flask\": executable file not found in $PATH": unknown
Encountered errors while bringing up the project.

我的码头文件:

Docker-compose.yml:

version: '3.6'
services:
  web:
    build: .
    ports:
      - "5122:5122"

Requirement.txt:

赛通==0.29.17 烧瓶==0.0.1 烧瓶-Cors==3.0.8 boto==2.49.0 boto3==1.10.7 botocore==1.13.7 证书==2019.9.11 chardet==3.0.4 循环仪==0.10.0 docutils==0.15.2 gensim==3.8.1 idna==2.8 jmespath==0.9.4 作业库==0.14.0 奇异果求解器==1.1.0 matplotlib==3.1.1 熊猫==0.25.2 pyparsing==2.4.2 python-dateutil==2.8.0 pytz==2019.3 请求==2.22.0 s3transfer==0.2.1 scikit-learn==0.21.3 海生==0.9.0 六==1.12.0 sklearn==0.0 智能打开==1.8.4 tqdm==4.37.0 urllib3==1.25.6

谁能帮我解决这个问题,我在网站上进行了研发,但没有找到确切的解决方案。

【问题讨论】:

  • 您似乎附上了 Dockerfile 的屏幕截图,而不是实际文件。你能用它的实际内容替换它吗? Flask 是否真的包含在您的 requirements.txt 文件中?
  • @DavidMaze 是的。

标签: python-3.x docker flask pip alpine


【解决方案1】:

您使用了错误的 Flask 版本,应该是 Flask==1.1.1 并尝试。

【讨论】:

    猜你喜欢
    • 2020-08-22
    • 2020-12-15
    • 1970-01-01
    • 2021-06-08
    • 2021-04-23
    • 2018-09-21
    • 1970-01-01
    • 1970-01-01
    • 2021-08-17
    相关资源
    最近更新 更多