bgsthiago commented on issue #12537:
URL: https://github.com/apache/airflow/issues/12537#issuecomment-830190630
Apache Airflow version: apache-airflow==2.0.1
I was facing the same issue, I tried to mount a volume but when I execute
the python script, it didn't find the file.
t_docker = DockerOperator(
task_id='docker_command',
image='pipeline:latest',
api_version='auto',
auto_remove=True,
volumes=[
'/opt/airflow/pipelines/book/:/book/:rw',
],
command=['python', '/book/exec.py'],
do_xcom_push=False,
docker_url='unix://var/run/docker.sock',
network_mode='bridge'
)
Tried to pass `rw` in volumes too and now exec.py exists but Python says
that the file does not have the "__main__", it seems like the all the files in
`book/` are directories.
`[2021-04-30 15:27:20,858] {docker.py:263} INFO - /usr/local/bin/python:
can't find 'main' module in '/book/exec.py'`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]