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:c657baee1a0044ab8f5ee296d2381b85This 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:c657baee1a0044ab8f5ee296d2381b85This 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-rundocker 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.rhkb.cn/news/362974.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【红帽战报】6月RHCE考试喜报!

往期战报回顾: 点击查看【战报】5月RHCE考试喜报!通过率100% 点击查看【战报】4月份红帽考试战报! 点击查看【战报】PASS!PASS!2023年终来一波RHCE考试 微思网络-红帽官方授权合作伙伴!面向全国招生&…

Python爬取中国天气网天气数据.

一、主题式网络爬虫设计方案 1.主题式网络爬虫名称 名称:Python爬取中国天气网天气数据 2.主题式网络爬虫爬取的内容与数据特征分析 本次爬虫主要爬取中国天气网天气数据 3.主题式网络爬虫设计方案概述(包括实现思路与技术难点) reques…

[火灾警报系统]yolov5_7.0-pyside6火焰烟雾识别源码

国内每年都会发生大大小小的火灾,造成生命、财产的损失。但是很多火灾如果能够早期发现,并及时提供灭火措施,将会大大较小损失。本套源码采用yolov5-7.0目标检测算法结合pyside6可视化界面源码,当检测到火灾时,能否发出…

第三阶段Spark

Spark和PySpark的介绍 PySpark的相关设置 安装PySpark库 pip install pyspark pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspark 构建PySpark执行环境入口对象 # 导包 from pyspark import SparkConf, SparkContext# 创建SparkConf类对象 conf SparkConf()…

多行业预约门店服务小程序源码系统 支持多门店预约 带完整的安装代码包以及搭建教程

系统概述 该系统基于先进的云计算和大数据技术,采用模块化设计,具有高度的可扩展性和可定制性。无论是餐饮、美容美发、健身房还是其他服务行业,都可以通过该系统轻松实现多门店预约功能。同时,我们还提供了丰富的接口和插件&…

STM32-hal库学习(4)--usart/uart通信 (同时显示在oled)

前言: 关于usart详解: stm32-USART通信-CSDN博客 因为在oled上显示,我们直接在上一个工程进行修改: STM32_hal库学习(3)-OLED显示-CSDN博客 其他配置与oled显示工程保持不变,打开oled文件的…

html渲染的文字样式大小不统一解决方案

React Hooks 封装可粘贴图片的输入框组件(wangeditor)_react 支持图片拖拽的输入框-CSDN博客 这篇文章中的wangediter可粘贴图片的输入框,输入的文字和粘贴的文字在dangerouslySetInnerHTML渲染后出现了字体不统一的情况 在html中右键检查可…

短视频利器 ffmpeg (2)

ffmpeg 官网这样写到 Converting video and audio has never been so easy. 如何轻松简单的使用: 1、下载 官网:http://www.ffmpeg.org 安装参考文档: https://blog.csdn.net/qq_36765018/article/details/139067654 2、安装 # 启用RPM …

基于Java微信小程序火锅店点餐系统设计和实现(源码+LW+调试文档+讲解等)

💗博主介绍:✌全网粉丝10W,CSDN作者、博客专家、全栈领域优质创作者,博客之星、平台优质作者、专注于Java、小程序技术领域和毕业项目实战✌💗 🌟文末获取源码数据库🌟感兴趣的可以先收藏起来,还…

Dataease配置Nginx代理

Dataease配置Nginx代理 一.修改前端静态资源地址和后端接口地址 **1.**修改应用程序的上下文路径 配置文件地址:backend/src/main/resources 找到文件application-whole.properties,做如下修改: **2.**修改前端静态资源路径和打包配置 配…

【基于深度学习方法的激光雷达点云配准系列之GeoTransformer】——模型部分浅析(1)

【GeoTransformer系列】——模型部分 1. create_model2. model的本质3. 模型的主要结构3.1 backbone3.2 transformer本篇继续对GeoTransformer/experiments/geotransformer.kitti.stage5.gse.k3.max.oacl.stage2.sinkhorn/下面的trainval.py进行详细的解读,主要是模型部分, 可以…

【机器学习】ChatTTS:开源文本转语音(text-to-speech)大模型天花板

目录 一、引言 二、TTS(text-to-speech)模型原理 2.1 VITS 模型架构 2.2 VITS 模型训练 2.3 VITS 模型推理 三、ChatTTS 模型实战 3.1 ChatTTS 简介 3.2 ChatTTS 亮点 3.3 ChatTTS 数据集 3.4 ChatTTS 部署 3.4.1 创建conda环境 3.4.2 拉取源…

MySQL一条SQL语句的执行过程

例:SELECT * FROM USERS WHERE age 18 AND name student; 执行过程如下图: 综合上面的说明,我们分析下这个语句的执行流程: 1、使用连接器通过客户端/服务器通信协议与MySQL建立连接,并查询是否有权限。 2、MySQL8.…

[电子电路学]电路分析基本概念1

第一章 电路分析的基本概念和基本定律 电路模型 反映实际电路部件的主要电磁性质的理想电路元件及其组合,是实际电路电气特性的抽象和近似。 理想电路元件 实际电路器件品种繁多,其电磁特性多元而复杂,分析和计算时非常困难。而理想电路元件…

C# 在WPF .net8.0框架中使用FontAwesome 6和IconFont图标字体

文章目录 一、在WPF中使用FontAwesome 6图标字体1.1 下载FontAwesome1.2 在WPF中配置引用1.2.1 引用FontAwesome字体文件1.2.2 将字体文件已资源的形式生成 1.3 在项目中应用1.3.1 使用方式一:局部引用1.3.2 使用方式二:单个文件中全局引用1.3.3 使用方式…

Linux基础 - 使用 vsftpd 服务传输文件

零. 简介 文件传输协议(File Transfer Protocol,FTP)是用于在网络上进行文件传输的标准网络协议。 FTP 允许客户端和服务器之间进行文件的上传、下载、删除、重命名等操作。它基于客户端 - 服务器模型工作,通常使用 TCP 协议进行…

Arduino - Keypad 键盘

Arduino - Keypad Arduino - Keypad The keypad is widely used in many devices such as door lock, ATM, calculator… 键盘广泛应用于门锁、ATM、计算器等多种设备中。 In this tutorial, we will learn: 在本教程中,我们将学习: How to use key…

高性价比蓝牙耳机有哪些?2024超高性价比蓝牙耳机推荐

在2024移动互联网高速发展的时代,蓝牙耳机已成为我们生活中不可或缺的一部分。走在街头,低头看手机,滑动屏幕选歌,耳边传来清晰的旋律,这一幕已经成为现代生活的标配。但面对市场上琳琅满目的蓝牙耳机品牌和型号&#…

LabVIEW在光学与光子学实验室中的应用

光学与光子学实验室致力于光学和光子学前沿领域的研究,涉及超快光学、非线性光学、光纤通信、光子晶体等多个方向。实验室需要高精度的实验控制和数据采集系统,以进行复杂的光学实验,并对实验数据进行实时处理和分析。 项目需求 实时控制与监…

spring和springboot的关系是什么?

大家好,我是网创有方的站长,今天给大家分享下spring和springboot的关系是什么? Spring和Spring Boot之间的关系可以归纳为以下几个方面: 技术基础和核心特性: Spring:是一个广泛应用的开源Java框架&#…