Jenkins: Permission issue using Docker as build environment
I had the same issue with node. The thing is files in the container are owned by "root:root". Try adding docker args -u root:root:

docker { 
    image 'node:8'
    args '-u root:root'
}