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] jenkins 跑不起來 touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
分類:docker