Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

535
Vistas
Permission issue on running docker command in Python subprocess through Apache Airflow

Any idea why I can't run docker using Airflow?

The same docker command runs fine from terminal using the user that runs airflow. So there is no permission issue on the Linux side.

But when put it into Airflow dag, it complains

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/create: dial unix /var/run/docker.sock: connect: permission denied.

The command is simply docker run --rm -v /data:/data:ro docker_image mycommand. It is wrapped inside a python subprocess, so I can't use docker operator.

Note this is not the same issue with the question: How to fix "dial unix /var/run/docker.sock: connect: permission denied" when group permissions seem correct? There it is a linux permission issue as it cannot run the docker run command. Here the problem is more with Airflow, I think.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Faced a similar issue . Got it fixed by changing the default_owner(default=airflow) in airflow.cfg to the user having permission to access docker(i.e username belonging to docker group).

Interestingly passing owner in 'default_args' in the DAG definition didn't seem to work

over 4 years ago · Santiago Trujillo Denunciar

0

Looks like the reason is in access rights to /var/run/docker.sock. For dev environment, you can do:

docker exec -ti -u root <container> bash
sudo chmod 777 /var/run/docker.sock
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda