我在使用 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
entrypoint.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