Docker 安装最新版本 Jenkins

news2024/11/25 22:25:53

目录

1、下载、启动容器、更新到最新版本

2、查看初始密码两种方式:

3、默认安装的部分未汉化,删除默认的汉化插件。重启容器,重新安装汉化插件

4、安装 Publish over SSH、docker-build-step 、Docker Commons 插件

5、配置服务器连接信息

6、构建自由风格的软件项目

7、构建异常(“uri was not specified”)并解决


1、下载、启动容器、更新到最新版本

获取最新版Jenkins war包,用于更新旧版本:https://www.jenkins.io/download/。下载上传至服务器。

[root@Tseng-HW ~]# docker pull jenkins/jenkins

………………

[root@Tseng-HW ~]# docker images
REPOSITORY                                    TAG       IMAGE ID       CREATED         SIZE
jenkins/jenkins                               latest    55860ee0cd73   2 years ago     442MB
[root@Tseng-HW data]# mkdir jenkins_home
[root@Tseng-HW data]# chmod 777 jenkins_home
-- 打开 服务器对应 1581 端口
[root@Tseng-HW data]# docker run -d -p 50000:50000 -p 1581:8080 --name=jenkins --restart=always -v /data/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/loacaltime -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v /usr/local/shell:/usr/local/shell jenkins/jenkins
235130a2d962fc40da331e4a567e73ec0eaf7ced50fe3d8266431cd45c412f9e
-- 把最新版本的war包替换到已安装的容器中
[root@Tseng-HW data]# cp jenkins.war /data/jenkins_home/jenkins.war
[root@Tseng-HW data]# docker exec -it -u root jenkins bash
root@235130a2d962:/# cd /usr/share/jenkins/
root@235130a2d962:/usr/share/jenkins# cp jenkins.war jenkinsBAK.war
root@235130a2d962:/usr/share/jenkins# cp /var/jenkins_home/jenkins.war /usr/share/jenkins/
root@235130a2d962:/usr/share/jenkins# exit
exit
[root@Tseng-HW data]# docker restart jenkins
jenkins
[root@Tseng-HW data]# 

2、查看初始密码两种方式:

1、查看初始密码文件:cat /data/jenkins_home/secrets/initialAdminPassword

2、查看容器日志:docker logs c53f

[root@Tseng-HW jenkins_home]# cat /data/jenkins_home/secrets/initialAdminPassword 
c657baee1a0044ab8f5ee296d2381b85
[root@Tseng-HW jenkins_home]# docker logs c53f
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2024-06-24 06:37:01.666+0000 [id=1]	INFO	org.eclipse.jetty.util.log.Log#initialized: Logging initialized @573ms to org.eclipse.jetty.util.log.JavaUtilLog
2024-06-24 06:37:01.777+0000 [id=1]	INFO	winstone.Logger#logInternal: Beginning extraction from war file
2024-06-24 06:37:02.868+0000 [id=1]	WARNING	o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2024-06-24 06:37:02.926+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStart: jetty-9.4.43.v20210629; built: 2021-06-30T11:07:22.254Z; git: 526006ecfa3af7f1a27ef3a288e2bef7ea9dd7e8; jvm 11.0.13+8
2024-06-24 06:37:03.190+0000 [id=1]	INFO	o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2024-06-24 06:37:03.224+0000 [id=1]	INFO	o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2024-06-24 06:37:03.224+0000 [id=1]	INFO	o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2024-06-24 06:37:03.226+0000 [id=1]	INFO	o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms
2024-06-24 06:37:03.724+0000 [id=1]	INFO	hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2024-06-24 06:37:04.047+0000 [id=1]	INFO	o.e.j.s.handler.ContextHandler#doStart: Started w.@3f049056{Jenkins v2.328,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2024-06-24 06:37:04.087+0000 [id=1]	INFO	o.e.j.server.AbstractConnector#doStart: Started ServerConnector@45e37a7e{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-06-24 06:37:04.088+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStart: Started @2999ms
2024-06-24 06:37:04.089+0000 [id=23]	INFO	winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2024-06-24 06:37:04.298+0000 [id=30]	INFO	jenkins.InitReactorRunner$1#onAttained: Started initialization
2024-06-24 06:37:04.348+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2024-06-24 06:37:05.269+0000 [id=30]	INFO	jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2024-06-24 06:37:05.273+0000 [id=30]	INFO	jenkins.InitReactorRunner$1#onAttained: Started all plugins
2024-06-24 06:37:05.282+0000 [id=31]	INFO	jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2024-06-24 06:37:06.027+0000 [id=28]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
2024-06-24 06:37:06.028+0000 [id=28]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
2024-06-24 06:37:06.028+0000 [id=28]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2024-06-24 06:37:06.033+0000 [id=28]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2024-06-24 06:37:06.089+0000 [id=44]	INFO	hudson.model.AsyncPeriodicWork#lambda$doRun$1: Started Download metadata
2024-06-24 06:37:06.121+0000 [id=44]	INFO	hudson.util.Retrier#start: Attempt #1 to do the action check updates server
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/var/jenkins_home/war/WEB-INF/lib/groovy-all-2.4.21.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2024-06-24 06:37:06.777+0000 [id=28]	INFO	jenkins.install.SetupWizard#init: 

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

c657baee1a0044ab8f5ee296d2381b85

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

2024-06-24 06:37:27.036+0000 [id=28]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2024-06-24 06:37:27.060+0000 [id=22]	INFO	hudson.WebAppMain$3#run: Jenkins is fully up and running
2024-06-24 06:37:27.863+0000 [id=44]	INFO	h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2024-06-24 06:37:27.864+0000 [id=44]	INFO	hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
2024-06-24 06:37:27.866+0000 [id=44]	INFO	hudson.model.AsyncPeriodicWork#lambda$doRun$1: Finished Download metadata. 21,760 ms
Running from: /usr/share/jenkins/jenkins.war
webroot: /var/jenkins_home/war
2024-06-24 06:38:54.411+0000 [id=1]	INFO	winstone.Logger#logInternal: Beginning extraction from war file
2024-06-24 06:38:55.625+0000 [id=1]	WARNING	o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2024-06-24 06:38:55.718+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStart: jetty-10.0.20; built: 2024-01-29T20:46:45.278Z; git: 3a745c71c23682146f262b99f4ddc4c1bc41630c; jvm 11.0.13+8
2024-06-24 06:38:56.065+0000 [id=1]	INFO	o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2024-06-24 06:38:56.159+0000 [id=1]	INFO	o.e.j.s.s.DefaultSessionIdManager#doStart: Session workerName=node0
2024-06-24 06:38:56.665+0000 [id=1]	INFO	hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2024-06-24 06:38:56.812+0000 [id=1]	INFO	o.e.j.s.handler.ContextHandler#doStart: Started w.@319c3a25{Jenkins v2.452.2,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2024-06-24 06:38:56.830+0000 [id=1]	INFO	o.e.j.server.AbstractConnector#doStart: Started ServerConnector@7a560583{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-06-24 06:38:56.846+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStart: Started Server@235a0c16{STARTING}[10.0.20,sto=0] @3086ms
2024-06-24 06:38:56.849+0000 [id=23]	INFO	winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2024-06-24 06:38:57.138+0000 [id=30]	INFO	jenkins.InitReactorRunner$1#onAttained: Started initialization
2024-06-24 06:38:57.184+0000 [id=29]	INFO	hudson.PluginManager#loadDetachedPlugins: Upgrading Jenkins. The last running version was 2.328. This Jenkins is version 2.452.2.
2024-06-24 06:38:57.246+0000 [id=29]	INFO	hudson.PluginManager#loadDetachedPlugins: Upgraded Jenkins from version 2.328 to version 2.452.2. Loaded detached plugins (and dependencies): [javax-mail-api.hpi, bouncycastle-api.hpi, instance-identity.hpi, javax-activation-api.hpi]
2024-06-24 06:38:57.512+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2024-06-24 06:38:58.809+0000 [id=31]	INFO	jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2024-06-24 06:38:58.829+0000 [id=31]	INFO	jenkins.InitReactorRunner$1#onAttained: Started all plugins
2024-06-24 06:38:58.834+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2024-06-24 06:38:59.436+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
2024-06-24 06:38:59.436+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
2024-06-24 06:38:59.436+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2024-06-24 06:38:59.439+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2024-06-24 06:38:59.540+0000 [id=29]	INFO	jenkins.install.SetupWizard#init: 

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

c657baee1a0044ab8f5ee296d2381b85

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/var/jenkins_home/war/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2024-06-24 06:39:15.240+0000 [id=29]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2024-06-24 06:39:15.297+0000 [id=22]	INFO	hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
[root@Tseng-HW jenkins_home]#

安装推荐的插件

 

 IP 默认当前服务器IP地址。可在端口后方加其他字符串

 

3、默认安装的部分未汉化,删除默认的汉化插件。重启容器,重新安装汉化插件

 

4、安装 Publish over SSH、docker-build-step 、Docker Commons 插件

 

5、配置服务器连接信息

测试是否连通

6、构建自由风格的软件项目

 添加git 用户名、密码信息,

生成容器,保存容器

 

 构建后动作,执行容器命令,启动容器

 Exec command 中内容

image_name=Tseng-gateway
container_name=Tseng-gateway
image_tag=latest
user_dir=/data
archive_dir_name=package-run

docker stop $container_name
docker rm $container_name -f
docker rmi $image_name:$image_tag -f
cd $user_dir/$archive_dir_name  && docker load -i $image_name:$image_tag.tar
mkdir -p $user_dir/$container_name
docker run -it --name $container_name \
-e profiles_active=test \
-e jvm_ms=1024m \
--net=host \
-m 1024m  \
--privileged=true \
--restart=always \
-v $user_dir/$container_name/output:/usr/local/app/output \
-v $user_dir/$container_name/dump:/usr/local/app/dump \
-d $image_name:$image_tag
docker logs --tail 1000 $container_name

7、构建异常(“uri was not specified”)并解决

构建成功后,制作docker镜像异常:uri was not specified

修改docker.service

命令:vim /lib/systemd/system/docker.service 。

添加:-H tcp://0.0.0.0:23578 -H unix:///var/run/docker.sock

在jenkins管理界面中。系统管理-系统设置-Docker Builder 中,将Docker URL改成tcp://本机IP:23758 ,保存

重启docker

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1873436.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Arduino - LED 矩阵

Arduino - LED 矩阵 Arduino - LED Matrix LED matrix display, also known as LED display, or dot matrix display, are wide-used. In this tutorial, we are going to learn: LED矩阵显示器,也称为LED显示器,或点阵显示器,应用广泛。在…

人大金仓×深信服:打造高性能、高可靠教育信创数据库一体机解决方案

信息技术应用创新是数字经济发展的关键支撑和重要基石,近年来,国家高度重视信息技术应用创新产业发展。教育行业作为我国人才培养的发动机,发展教育信创是保持信创创新力、是提升信创人才质量的重要举措、是保障信创产业可持续发展的关键环节…

做短视频赛道,云微客矩阵系统提醒这些雷区要避开!

90%的实体老板做抖音短视频都踩过雷区,那就是上来就真人出镜拍视频,要么自己上要么让员工上。但是我们大家试想下,企业做短视频是想借助平台流量找客户的,又不是来当网红的,拍剧情、想段子,无非就是浪费时间…

Redis集群部署合集

目录 一. 原理简述 二. 集群配置​​​​​​​ 2.1 环境准备 2.2 编译安装一个redis 2.3 创建集群 2.4 写入数据测试 实验一: 实验二: 实验三: 实验四: 添加节点 自动分配槽位 提升节点为master: 实验…

docker 学习之路

文章目录 1、官方文档2、常用命令挂载Docker容器内运行的脚本或命令常用 3、介绍4、Dockerfile5、问题6、链接 ​ 1、官方文档 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的 Linux…

【软件测试】对于测试中各式的概念,你了解多少?

目录 1.需求 2.开发模型 2.1.软件的生命周期 2.2.瀑布模型 2.3.螺旋模型 2.4.增量模型、迭代模型 2.5.敏捷模型 3.测试模式 3.1.V模型 3.2.双V模型 在学习后面的知识前,先来熟知一个概念 什么是软件测试:软件测试就是验证软件产品特性是否满足…

[java多版本管理] JEnv-for-Windows 详细安装和使用

文章目录 JEnv-for-Windows文件下载地址用法(注意:本地覆盖更改。使用本地覆盖)这是如何工作的?java 常用的版本 JEnv-for-Windows文件下载地址 温馨提示: 需要元子 文件下载地址 管理员执行jenv.bat文件 执行正常, 接下来就是…

AUTOSAR NvM模块(一)

NvMBlockDescriptor [ECUC_NVM_00061] 用于存储所有特定于块的配置参数的容器。对于每个非易失性随机存取存储器(NVRAM)块,应该指定这个容器的一个实例。 NvMBlockCrcType 定义了NVRAM块的CRC数据宽度。根据Autosar标准,此参数…

msvcp120.dll文件不见了要怎么处理?教你科学的方法修复msvcp120.dll

msvcp120.dll文件不见了?那么这时候你就要注意了,有可能你的某些程序已经打不开了!因为这个msvcp120.dll文件是用来支持程序运行的,下面我们一起来聊一下msvcp120.dll文件不见了要怎么修复。 一.msvcp120.dll文件讲解 msvcp120.d…

Java SE入门及基础(58) 并发 进程与线程概念

目录 并发 进程和线程 1. 进程和线程 2. 进程 3.线程 总结 并发 并发(Concurrency) Computer users take it for granted that their systems can do more than one thing at a time. They assume that they can continue to work in a word processor, while other app…

AI大模型怎么备案?

随着人工智能技术的飞速发展,生成式AI正逐渐渗透到我们的日常生活和各行各业中。从文本创作到艺术设计,从虚拟助手到智能客服,AI的身影无处不在。然而,技术的创新与应用,离不开法律的规范与引导。为进一步保障和监管AI…

《昇思25天学习打卡营第2天|快速入门》

文章目录 前言:今日所学:1. 数据集处理2. 网络的构建3. 模型训练4. 保存模型5. 加载模型 总体代码与运行结果:1. 总体代码2. 运行结果 前言: 今天是学习打卡的第2天,今天的内容是对MindSpore的一个快速入门&#xff0…

HarmonyOS ArkUi ArkWeb加载不出网页问题踩坑

使用 使用还是比较简单的,直接贴代码了 别忘了配置网络权限 Entry Component struct WebPage {State isAttachController: boolean falseState url: string State title: string Prop controller: web_webview.WebviewController new web_webview.WebviewCont…

锐捷网络闪耀CVPR 2024,外观异常检测方案斩获世界认可!

近日,锐捷网络在“视觉异常检测和创新性检测2024挑战赛”(Visual Anomaly and Novelty Detection 2024 Challenge,简称VAND)的少样本逻辑/结构异常检测赛道(VAND 2.0赛道2)中荣获第二名,并在计算机视觉顶级会议CVPR 2024上展示了这一成果&…

详细介绍LP-SCADA系统的核心数据采集单元

关键字:LP-SCADA系统, 传感器可视化, 设备可视化, 独立SPC系统, 智能仪表系统,SPC可视化,独立SPC系统 SCADA系统的数据采集功能是其核心组成部分,它允许系统从各种传感器、仪器和设备中收集实时数据。以下是SCADA系统数据采集功能的详细描述: 传感器和…

我的创作纪念日学期总结

🔥个人主页: Forcible Bug Maker 🔥专栏: 关于博主 目录 🌈前言🔥我的期末考试🔥我的学期总结🔥对未来的展望🌈结语 🌈前言 本篇博客主要内容:博…

SOLIDWORKS Electrical智能模型--实现机电一体化设计的关键

SOLIDWORKS Electrical 3D布线可以根据原理图自动生成线路,并且电气属性可以自动与导轨或机柜进行配合放置。但是这些电气模型该如何添加这些属性呢? 1.首先确保我们已经打开SOLIDWORKS Electrical 3D插件,接着打开一个模型,此处以…

【新版本来袭】ONLYOFFICE桌面编辑器8.1 —— 重塑办公效率与体验

文章目录 一、功能完善的PDF编辑器:重塑文档处理体验编辑文本插入和修改各种对象,如表格、形状、文本框、图像、艺术字、超链接、方程式等添加、旋转和删除页面添加文本注释和标注 二、幻灯片版式设计:创意展示的无限舞台三、改进从右至左显示…

使用SpringBoot整合Listener

常用的Web事件的监听接口如下: ServletContextListener:用于监听Web的启动及关闭 ServletContextAttributeListener:用于监听ServletContext范围内属性的改变 ServletRequestListener:用于监听用户请求 ServletRequestAttributeLi…

博睿数据受邀出席GOPS全球运维大会北京站,分享《一体化可观测数据模型和AIOps的融合实践》

2024年6月28日,第二十三届 GOPS 全球运维大会暨 XOps 技术创新峰会在北京顺利召开。大会为期2天,侧重 BizDevOps、XOps、DevOps、持续测试、SRE、可观测性、云原生等热门技术领域。并特别设置大模型运维、银行/证券数字化转型、平台工程、DevOps/AIOps 最…