docker运行jenkins

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

初始化

http://192.168.99.100:8080/
docker运行jenkins

安装推荐的插件
docker运行jenkins

或者自己选择要安装的plugin
docker运行jenkins

进入jenkins
docker运行jenkins

doc

相关推荐