0

I'm working on airflow with docker. My python file has json path like:

'/home/user_name/airflow2-local_setup/credentials/my_file.json'

I'm using it my python file in dags directory. In web ui got an error

    Broken DAG ...  
FileNotFoundError: [Errno 2] No such file or directory: '/home/user_name/airflow2-local_setup/credentials/my_file.json'

How can i give file path to airflow?

EEks
  • 51
  • 5
  • You need to mount that file as a volume into your container. The docker container will otherwise have no access to that file on your system – C.Nivs Feb 13 '21 at 16:40
  • have you copied the file into the image defined on your dockerfile? – kucing_terbang Feb 13 '21 at 16:49
  • @kucing_terbang That may solve the issue in the short term, but credentials/configuration should be excluded from the image and mounted in at runtime where possible – C.Nivs Feb 13 '21 at 17:03
  • I guess, it depends on the context. But, true, usually it will be loaded once in runtime. But, I guess that is another question different from what op's asking – kucing_terbang Feb 13 '21 at 17:07
  • i got it. After use copy command in dockerfile, should i determine path according to docker path or my local? – EEks Feb 13 '21 at 17:23

0 Answers0