Home > database >  Cannot copy airflow.cfg
Cannot copy airflow.cfg

Time:06-03

I would like to extract the 'airflow.cfg' file from docker container to make an easy access to configuration. I tried everything but I cannot copy this particular file.

The last volume creates only folder airflow.cfg ...

   volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    - ./config/airflow.cfg:/opt/airflow/airflow.cfg

I can copy the entire folder with path:

- `./config/:/opt/airflow/`

example

but not just the airflow.cfg file...

Any suggestions? Thank you in advance.

CodePudding user response:

By default, - ./config/airflow.cfg:/opt/airflow/airflow.cfg

will create a folder;

try reading the file airflow.cfg from the docker using docker exec -it <docker container name> cat /opt/airflow/airflow.cfg and create the file ./config/airflow this way the volume will not create any folder and you could then for use this file to edit your in docker file

  • Related