What are the correct permission settings when running Docker in a Jenkins Pipeline?
So after a debug session in chat what is needed is to allow the user running jenkins to be able to sudo docker passwordless on the docker host. 

A typical sudoers file on ubuntu could be in /etc/sudoers.d/jenkins

jenkins_user ALL=(ALL) NOPASSWD:ALL


Be warned this allow jenkins_user to run as root without password any command, a better file should be:

jenkins_user ALL=(ALL) NOPASSWD:/full/path/to/docker
jenkins_user ALL=(ALL) NOPASSWD:&lt;other needed command to be run as root&gt;


This will allow to start the container as root and as such it gives all rights within the container itself by running as uid 0.

Useful resources used aside:


Jenkins docker plugin readme
How to setup passwordless sudo on Linux?