0
votes

I had airflow installed locally in a server and I used it to create and run docker containers. I had to change airflow to run in docker itself. Now I wanted this airflow inside the docker to create and run other docker containers.

What most answers I found online suggest is to create a volume exposing the docker socket in the host to the container. Like many answers here:

Airflow inside docker running a docker container

At the same time, many people on the internet say this is a bad practice because anyone who could access the container would have root access to host. Like here:

https://www.lvh.io/posts/dont-expose-the-docker-socket-not-even-to-a-container/

Since Docker in Docker is also regarded as something to avoid if possible, what is the best way of having airflow in docker creating and running other containers?

Thanks!