touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
docker 运行后, 执行docker logs -f myjenkins时报错:
touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
需要修改下目录权限, 因为当映射本地数据卷时,/home/docker/jenkins目录的拥有者为root用户,而容器中jenkins user的uid为1000
执行如下命令即可:
chown -R 1000:1000 /home/docker/jenkins
转载:
https://segmentfault.com/a/1190000008618462