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.
Maybe you should run the docker with option "-u root" from the very beginning
At least that solved my problem