拉取并运行
# 取并运行①
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
查看jenkins运行日志
docker logs jenkins
# f:实时刷新
docker logs -f jenkins
查看Jenkins密码
i:交互
t:终端
docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
访问Jenkins:http://127.0.0.1:8080/
如果Jenkins无法运行,可能是未授权:chmod 777 jenkins