运行Docker容器的Docker内部的气流 [英] Airflow inside docker running a docker container

查看:94
本文介绍了运行Docker容器的Docker内部的气流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在EC2实例上运行着气流,并且正在计划一些启动Docker容器的任务。我怎么做?我需要在气流容器上安装docker吗?接下来的下一步是什么。我有一个yaml文件,该文件用于旋转容器,它来自puckel / airflow Docker镜像

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? And what is the next step after. I have a yaml file that I am using to spin up the container, and it is derived from the puckel/airflow Docker image

推荐答案

我有一个更简单的解决方案,它只需要一个短的Dockerfile即可构建派生映像:​​

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

然后是

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

这篇关于运行Docker容器的Docker内部的气流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆