docker: Got permission denied while trying to connect to the Docker daemon socket Post dial unix /var/run/docker.sock: connect: permission denied.

+1 vote

Hi Guys,

I am trying to run one docker container from jenkins shell, but it is showing me the below error.

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.37/containers/create?name=web: dial unix /var/run/docker.sock: connect: permission denied.

How can I solve this?

May 5 in Jenkins by akhtar
• 11,270 points
290 views

1 answer to this question.

0 votes

Hi@akhtar,

Here you have to give root power to your jenkins user. Otherwise your jenkins user will not able to run any job in your system.

If you are using Linux system, then open /etc/sudoers file and write down the bellow given line.

jenkins ALL=(ALL) NOPASSWD: ALL

Hope this will help.

answered May 5 by MD
• 24,500 points

Related Questions In Jenkins

0 votes
1 answer
+2 votes
3 answers

Permission denied error while running a simple job in Jenkins

Hey @Hannah, try changing the permissions using ...READ MORE

answered Oct 25, 2018 in Jenkins by krishti
16,719 views
0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 9,940 points
711 views
+1 vote
4 answers

Is there a way to change the Jenkins build number while building a job?

If you have access to the script ...READ MORE

answered May 7, 2019 in Jenkins by Atul
8,273 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,530 points
542 views
0 votes
1 answer

/tmp/jenkins6403305246799294208.sh: line 2: cd: /root: Permission denied

Hi@akhtar, You are getting permission denied because you ...READ MORE

answered Feb 6 in Jenkins by MD
• 24,500 points
261 views