- # 取并运行①
- docker run -d --name=jenkins -p 8080:8080 jenkins/jenkins
-
- # 或者拉取到指定路径并运行②
- docker run --name=jenkins -d -p 8080:8080 -p 5000:5000 -v ${PWD}/jenkins:/var/jenkins_home jenkins/jenkins
- docker logs jenkins
-
- # f:实时刷新
- docker logs -f jenkins
i:交互
t:终端
docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
访问Jenkins:http://127.0.0.1:8080/
如果Jenkins无法运行,可能是未授权:chmod 777 jenkins