1.拉取jenkins镜像:
docker pull jenkins/jenkins:latest
2.查看镜像:
docker images | grep jenkins
3.创建目录:
mkdir -p /home/jenkins
4.修改用户组权限:
chown -R 1000:1000 /home/jenkins/
5.启动jenkins镜像:
docker run -d --name jenkins -p 8080:8080 -v /home/jenkins:/var/jenkins_home jenkins/jenkins
6.查看jenkins容器是否已运行:
docker ps -a | grep jenkins
7.前台访问jenkins:
ip:8080
8.获取admin密钥后填入前台输入框:
docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
网友评论