docker - 官方 Airflow docker-compose 中的自定义airflow.cfg

标签 docker docker-compose airflow

我从 this 运行 Airflow官方 docker-compose。我想在网络应用程序中隐藏默认 DAG。通常可以在airflow.cfg中做到这一点,如何在docker-compose中隐藏默认的DAG?

干杯。

最佳答案

您可以通过使用遵循此语法 AIRFLOW__{SECTION}__{KEY} 的环境变量来设置 airflow.cfg 中存在的任何选项:

Sets options in the Airflow configuration. This takes priority over the value in the airflow.cfg file. Replace the {SECTION} placeholder with any section and the {KEY} placeholder with any key in that specified section.

检查您从 Airflow 获得的 docker-compose.yaml 文件,并将 AIRFLOW__CORE__LOAD_EXAMPLES var 的值更改为 false,如下所示:

---
version: '3'
x-airflow-common:
  &airflow-common
images.
  image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.1.4}
  # build: .
  environment:
    &airflow-common-env
    AIRFLOW__CORE__EXECUTOR: CeleryExecutor
    AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
    AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
    AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
    AIRFLOW__CORE__FERNET_KEY: ''
    AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
    AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
    AIRFLOW__API__AUTH_BACKEND: 'airflow.api.auth.backend.basic_auth'
    _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
  volumes:

文档 here .

关于docker - 官方 Airflow docker-compose 中的自定义airflow.cfg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69416963/

相关文章:

linux - Docker Compose 中的 MongoDb - 提供配置

Airflow :日志文件不是本地的,不受支持的远程日志位置

带有 docker-compose 的 Django 应用程序将数据保存在媒体卷中

postgresql - 我在docker-compose中为.netcore和postgres做错了什么?

python - Airflow :在位移运算符之前跳过行

python - 将 `http_conn_id` 传递给 SlackWebhookOperator 时出现问题

docker - Docker Swarm无法与自定义覆盖网络上的其他节点通信

apache - https 在多个 docker 容器中

php - 从 docker nginx/php-fpm 安装在本地卷(Mac)上的 Laravel 无法写入 session 文件

java - Java 应用 Docker 化时串口访问失败