繁体   English   中英

Docker-compose:OCI 运行时创建失败,entrypoint.sh 没有这样的文件或目录

[英]Docker-compose: OCI runtime create failed, no such file or directory for entrypoint.sh

使用 entrypoint.sh 文件时,我正在努力运行 docker-compose。 即使我对文件运行了 chmod +x,我还是收到了这个错误。 知道我做错了什么吗?

ERROR: for airflow_webserver_1  Cannot start service webserver: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"./airflow/scripts/entrypoint.sh\": stat ./airflow/scripts/entrypoint.sh: no such file or directory": unknown

文件夹结构:

|--airflow
   |--dags
   |--logs
   |--scripts
      |--entrypoint.sh
|--.env
|--docker-compose.yml

入口点.sh:

#!/bin/sh
airflow db init
airflow webserver

docker-compose.yml

version: '3.0'
services:
  webserver:
    image: apache/airflow:1.10.14
    volumes:
      - ./airflow/dags:/opt/airflow/dags
      - ./airflow/logs:/opt/airflow/logs
      - ./airflow/scripts:/opt/airflow/scripts
    ports:
      - "8080:8080"
    deploy:
      restart_policy:
        condition: on-failure
        max_attempts: 3
    env_file:
      .env
    entrypoint: ./airflow/scripts/entrypoint.sh
  scheduler:
    image: apache/airflow:1.10.14
    command: ["scheduler"]
    volumes:
      - ./airflow/dags:/opt/airflow/dags
      - ./airflow/logs:/opt/airflow/logs
    deploy:
      restart_policy:
        condition: on-failure
        max_attempts: 3
    env_file:
      .env

首先在entrypoint文件所在的airflow文件夹下使用如下命令给entrypoint.sh权限

chmod +x ./file-if-any/entrypoint.sh

那么接下来就是让脚本在容器中可执行。 添加下面的代码行

RUN chmod +x ./file-if-any/entrypoint.sh

我遇到了同样的问题,并且能够用这个解决它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM