-
拉取 jenkins 镜像:
docker pull jenkins/blueocean:latest
-
查看镜像:
docker images | grep jenkins
-
创建目录:
mkdir -p /home/jenkins
-
修改用户组权限:
chown -R 1000:1000 /home/jenkins/
-
启动 jenkins 镜像:
docker run -d --name jenkins -p 8080:8080 --restart always -v /home/jenkins:/var/jenkins_home jenkins/blueocean
-
查看 jenkins 容器是否已运行:
docker ps -a | grep jenkins
-
前台访问 jenkins:
localhost:8080 -
获取 admin 密钥后填入前台输入框:
docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword