+1
Same problem here.
A quick and dirty fix I found was to do this:
pipeline {{{ }}
...
post { always { sh "chmod -R 777 ." {{ cleanWs()}} {{ }}} {{ }}} }
It allows anyone to modify workspace files so that Jenkins can clean it.
This helps in my case:
stages { stage('Build') { steps { script { image = docker.build() } } } } post { cleanup { script { image.inside('-u root') { sh "chmod -R 777 ." } } deleteDir() } }