Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dial unix /var/run/docker.sock: connect: permission denied #4

Closed
chafey opened this issue May 19, 2018 · 1 comment
Closed

dial unix /var/run/docker.sock: connect: permission denied #4

chafey opened this issue May 19, 2018 · 1 comment

Comments

@chafey
Copy link

chafey commented May 19, 2018

I get the above error when trying do use docker from my Jenkinsfile. If I run the jenkins process as root, it works fine. I am not sure what the right fix is - change permission on /var/run/docker.sock, run jenkins as root or some other change.

@Shimmi
Copy link
Owner

Shimmi commented May 25, 2018

Hi @chafey,
As you correctly pointed out, this is because Jenkins lacks permissions to access the socket to communicate with the Docker engine. You basically need to add Jenkins user to the docker group (usermod -a -G docker jenkins). Yet this can be a bit tricky due to mixing GID/UID of host and guest OS (as mentioned in #3).

You may run the Jenkins as a root, but please be aware this is not recommended and can be insecure, but can be sufficient for testing and personal set-up.

Please take a look e.g. at this issue for more info jenkinsci/docker#263.

@Shimmi Shimmi closed this as completed May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants