跳至主要內容

[docker] jenkins 跑不起來 touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied

pull镜像
docker pull jenkins
run
为了方便安装插件,因此将jenkins_home目录映射出来

docker run -p 8080:8080 -p 50000:50000 -v /home/docker/jenkins:/var/jenkins_home jenkins

报错:
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
sudo chown -R 1000:1000 /home/docker/jenkins
https://www.jianshu.com/p/3671eb8de971

分類:docker
由 Compete Themes 設計的 Author 佈景主題