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.
chmod 777 /var/run/docker.sock
This worked like a charm