After we installed Docker on the Jenkins server and started it, when we try to build, we get the following error:
1 | dial unix /var/run/docker .sock: connect: permission denied |
Solution:
Add the user "jenkins" to the "docker" group:
1 | sudo usermod -aG docker jenkins |
After that, the user "jenkins" will be able to work with Docker if he connects via SSH, but with Jenkins job there will still be the same error, to get rid of it, you need to restart the Jenkins service:
1 | sudo systemctl restart jenkins |