Jenkins Docker permission denied error
There’s an easy fix to the “Permission denied while trying to connect to the Docker daemon socket” error you encounter when you run a Jenkins build or a pipeline’s Jenkinsfile that accesses a Docker image. It’s just a single terminal command and then a reboot:
sudo usermod -a -G docker jenkins
Run this command and Jenkins will be able to invoke a Docker run command and the Docker daemon socket issues will go away.