I am new to docker. I just tried to use docker in my local machine(Ubuntu 16.04) with Jenkins.
I configured a new job with below pipeline script.
I added the jenkins user to root group and restarted the jenkins and it started working.
sudo usermod -a -G root jenkins sudo service jenkins restart