Docker 安装最新版本 Jenkins

目录

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

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【LLM 论文】Self-Refine:使用 feedback 迭代修正 LLM 的 output

论文:Self-Refine: Iterative Refinement with Self-Feedback ⭐⭐⭐⭐ CMU, NeurIPS 2023, arXiv:2303.17651 Code: https://selfrefine.info/ 论文速读 本文提出了 Self-Refine 的 prompt 策略,可以在无需额外训练的情况下,在下游任务上产…

D13009-ASEMI电源开关三极管D13009

编辑:ll D13009-ASEMI电源开关三极管D13009 型号:D13009 品牌:ASEMI 批号:2024 沟道:NPN 电流:4A 电压:400V 安装方式:直插式封装 特性:NPN晶体管、三极管、12A…

分享10个AI搞钱副业,门槛低,普通人也能学的会!易上手!

前言 本期给大家分享的是利用AI 做副业的一些方法,大家可以挑选适合自己的赛道去搞钱 现在是人工智能时代,利用好AI 工具,可以降低普通人做副业的门槛,同时也能提高工作效率, 因此AI 赚钱的副业还是挺多的&#xff0…

【软考论文】项目背景及论文模版

目录 一、项目核心功能二、论文模板一、项目核心功能 二、论文模板 论文字数说明 总字数 2500 = 500 + 400 +400 * 3 + 300 背景:500 回答问题:400 三段论:1200 = 400 * 3 结论:300 ~ 400 摘要(<300字) 本人于2022年1月参与了某车厂的全渠道数字化精准营销平台项目,该…

想买一款好用的骨传导耳机怎么挑?一次给你搞定全方位的选购攻略

作为那么多年来购买了无数数码产品热爱听歌的我&#xff0c;也一直在寻找一款好的骨传导耳机&#xff0c;听音乐对我来说不仅仅是一种消遣方式&#xff0c;更多是一种对生活、工作上压力和困难的舒缓&#xff0c;在我购买了那么多款骨传导耳机中&#xff0c;对一些进行了测评与…

MySQL数据库——在Centos7环境安装

MySQL在Centos7环境安装 1.切换root用户 安装与卸载中&#xff0c;用户全部切换成为root&#xff0c;安装好后&#xff0c;普通用户也能使用 2.卸载不要的环境 要将自己环境中有关mysql的全都删除&#xff0c;避免安装过程中被影响 ps axj | grep mariadb 先检查是否有mari…

揭秘教学新利器:SmartEDA电路仿真软件,让电子学习更生动!

在数字化教育浪潮中&#xff0c;一款名为SmartEDA的电路仿真软件逐渐崭露头角&#xff0c;以其直观、易操作的特点&#xff0c;为电子学习领域带来了革命性的变化。今天&#xff0c;就让我们一起探讨如何使用SmartEDA进行教学&#xff0c;让电子学习变得更加生动有趣&#xff0…

健身馆预约小程序定制搭建会员管理系统次卡核销充值年卡saas账号

健身馆预约小程序定制搭建&#xff1a;打造高效会员管理系统 &#x1f3cb;️ 一、引言&#xff1a;为何需要健身馆预约小程序&#xff1f; 随着健康意识的提高&#xff0c;越来越多的人选择到健身馆进行锻炼。然而&#xff0c;传统的健身馆预约方式往往存在诸多不便&#xff…

Dataease安装,配置Jenkins自动部署

Dataease安装&#xff0c;配置Jenkins自动部署 一.安装Dataease 安装前准备&#xff1a;1.Ubuntu20.04 LTS国内源安装指定版本Docker 2.docker-compose安装 下载离线安装的安装包&#xff0c;下载地址&#xff1a;https://community.fit2cloud.com/#/download/dataease/v1-…

js导入导出

好久没有学习新的知识点了&#xff0c;今天开始学一下前端的知识点。直接在vscode里面编写&#xff0c;然后从基本的前端知识开始。 JS的导入导出 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"…

利用百数应用优化制造细节,提升生产效率的技术实践

制造管理是确保企业高效、高质生产的核心环节&#xff0c;对于提高企业的运营效率、质量控制、成本控制、交货期保障、资源优化、创新能力以及风险管理等方面都具有重要意义&#xff0c;它能帮助企业在激烈的市场竞争中保持领先地位&#xff0c;同时实现资源的有效利用和风险的…

动态规划06(leetcode322/279/139)—完全背包

参考资料&#xff1a; https://programmercarl.com/0322.%E9%9B%B6%E9%92%B1%E5%85%91%E6%8D%A2.html 322. 零钱兑换 题目描述&#xff1a; 给你一个整数数组 coins &#xff0c;表示不同面额的硬币&#xff1b;以及一个整数 amount &#xff0c;表示总金额。 计算并返回可以…

《昇思25天学习打卡营第5天 | 昇思MindSpore网络构建》

第五天 今天学习了神经网络模型是由神经网络层和Tensor操作构成的&#xff0c;mindspore.nn提供了常见神经网络层的实现&#xff0c;在MindSpore中&#xff0c;Cell类是构建所有网络的基类&#xff0c;也是网络的基本单元。一个神经网络模型表示为一个Cell&#xff0c;它由不同…

高性能Web服务器-Nginx的常用模块

文章目录 Nginx安装Nginx平滑升级与回滚平滑升级流程第1步&#xff0c;下载新版本第2步&#xff0c;编译第3步&#xff0c;执行make第4步&#xff0c;对比新旧版本第5步&#xff0c;备份旧nginx二进制文件第6步&#xff0c;模拟用户正在访问nginx第7步&#xff0c;替换旧的ngin…

航空电子制造业企业数字化转型:智能工厂建设

引言 航空电子制造业是航空工业的重要组成部分&#xff0c;涵盖了飞机的电子系统、导航设备、通信系统、自动驾驶仪等关键组件。自20世纪中期以来&#xff0c;航空电子技术经历了快速发展&#xff0c;从最初的机械和模拟设备逐步过渡到数字化、网络化和智能化系统。现代航空电子…

python办公自动化之excel

用到的库&#xff1a;openpyxl 实现效果&#xff1a;读取单元格的值&#xff0c;写入单元格 代码&#xff1a; import openpyxl # 打开现有工作簿 workbookopenpyxl.load_workbook(现有工作簿.xlsx) # 选择一个工作表 sheetworkbook[交易表] # 读取单元格的值 cell_valueshe…

海南云亿商务咨询有限公司深度解读抖音电商

在当今数字化飞速发展的时代&#xff0c;电商行业早已成为经济发展的重要引擎。而在众多电商平台中&#xff0c;抖音以其独特的短视频直播形式&#xff0c;成为了众多商家和消费者的新宠。海南云亿商务咨询有限公司&#xff0c;正是这一领域的佼佼者&#xff0c;专注于抖音电商…

vue3【实战】创建项目、创建并提交代码到远程仓库,安装 SASS, 清除浏览器默认样式 reset-css, 清除模板代码,提升开发效率的必要集成

新建远程仓库&#xff08;码云&#xff09; https://gitee.com/ 得到远程仓库地址 https://gitee.com/sunshine39/ec-web-vue3.git创建项目 vscode 安装插件 vue3-snippets-for-vscode安装 node v20.12.2设置淘宝镜像 npm config set registry https://registry.npmmirror.c…

【中项第三版】系统集成项目管理工程师 解析指南 | 报考 | 备考 | 总结

&#x1f4a1;&#x1f4a1;&#x1f4a1; 重要通知 &#x1f4a1;&#x1f4a1;&#x1f4a1; &#x1f33a;&#x1f33a;&#x1f33a; 2024下半年 使用《系统集成项目管理工程师教程》第三版 &#x1f33a;&#x1f33a;&#x1f33a; &#x1f680;&#x1f680;&#x1…

tauri使用github action实现跨平台编译并解决编译错误等问题

正常编译为跨平台结果就像上面的&#xff0c;有mac/windows/linux的安装程序&#xff0c;直接下载就可以安装使用&#xff0c;我的这个livebox桌面端仓库地址&#xff1a;GitHub - Sjj1024/LiveBox: livebox&#xff0c;里面有编译文件可以参考。今天主要讲一下遇到的问题。 官…