docker搭建jenkins服务的示例(jenkins构建docker镜像)

admin 228 2022-07-28

阿里云服务器优惠多,折扣错,惊喜多,请咨询:www.wqiis.com

拉取镜像

root@EricZhou-MateBookProX: docker pull jenkins/jenkins:lts lts: Pulling from jenkins/jenkins 3192219afd04: Pull complete 17c160265e75: Pull complete cc4fe40d0e61: Pull complete 9d647f502a07: Extracting [===================================> ] 35.65MB/50.07MB d108b8c498aa: Download complete 1bfe918b8aa5: Download complete dafa1a7c0751: Downloading [=================> ] 36.8MB/104.2MB 9221a8ef4852: Downloading [===> ] 3.116MB/44.27MB a79e75dd432b: Download complete efbc20726efc: Downloading

docker搭建jenkins服务的示例(jenkins构建docker镜像)

创建数据卷目录

makdir /home/jenkins

docker run 容器

docker run -d --name jenkins -p 7000:80 -v /home/jenkins:/home/jenkins jenkins/jenkins:lts

查看jenkins容器,status值为UP

root@EricZhou-MateBookProX: docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 29c2a14856be jenkins/jenkins:lts "/sbin/tini -- /usr/…" 22 seconds ago Up 21 seconds 8080/tcp, 50000/tcp, 0.0.0.0:7000->80/tcp jenkins

浏览器输入localhost:7000,访问以下页面

进入容器,获取密码,输入即可

# 进入容器 root@EricZhou-MateBookProX: docker exec -it jenkins bash # 获取密码 jenkins@2fdf047094f6:/$ cat /var/jenkins_home/secrets/initialAdminPassword 1c45086eac3043feade3e816a306cf5b

安装推荐的插件,等待安装过程,服务搭建完毕

以上就是docker搭建jenkins服务的示例的详细内容,更多关于docker搭建jenkins服务的资料请关注其它相关文章!

上一篇:服务器频繁死机的原因是什么?(服务器经常卡死)
下一篇:织梦dedecms出现Safe Alert: Request Error step 2提示代码(织梦cms教程梦使用教程)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~