I was getting this error when I was trying to run a docker container using jenkins declarative pipeline script. This was being run on my localhost and below is what I needed to correct it.
Added jenkins user to docker group
sudo usermod -a -G docker jenkins
The solution that actually worked was to change the permission of the sock file to 666
devops-04:~$ ls -al /var/run/docker.sock
srw-rw—- 1 root docker 0 Oct 28 11:54 /var/run/docker.sock
devops-04:~$ sudo chmod 666 /var/run/docker.sock
devops-04:~$ ls -al /var/run/docker.sock
Once this was done my pipeline script started working!
Recent Comments