Airflow inside docker running a docker container

前端 未结 3 2028
心在旅途
心在旅途 2021-02-06 05:02

I have airflow running on an EC2 instance, and I am scheduling some tasks that spin up a docker container. How do I do that? Do I need to install docker on my airflow container?

3条回答
  •  庸人自扰
    2021-02-06 06:03

    I got a simpler solution working which just requires a short Dockerfile to build a derived image:

    FROM puckel/docker-airflow
    
    USER root
    RUN groupadd --gid 999 docker \
        && usermod -aG docker airflow
    USER airflow
    

    and then

    docker build -t airflow_image .
    docker run -v /var/run/docker.sock:/var/run/docker.sock:ro \
        -v /usr/bin/docker:/bin/docker:ro \
        -v /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7:ro \
        -d airflow_image
    

提交回复
热议问题