Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

527
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!