当前位置: 首页 > news >正文

Docker 安装 Jenkins:2.346.3

准备:已安装Docker,已配置服务器安全组规则 1581

1、拉取镜像 

[root@Tseng ~]# docker pull jenkins/jenkins:2.346.3
2.346.3: Pulling from jenkins/jenkins
001c52e26ad5: Pull complete 
6b8dd635df38: Pull complete 
2ba4c74fd680: Pull complete 
451b84b3fbee: Pull complete 
bf1a1bca45f7: Pull complete 
034487302eff: Pull complete 
9ca88e78f65c: Pull complete 
9010fbe1f5af: Pull complete 
3f26de523f8f: Pull complete 
e575c61d2ce2: Pull complete 
ab1c361873a9: Pull complete 
179290c8c621: Pull complete 
04c857c79af2: Pull complete 
1158f52510d7: Pull complete 
Digest: sha256:cc62444630fb4b7c4694ac6b11b68dc64864a67fd98121194f913027733c9dce
Status: Downloaded newer image for jenkins/jenkins:2.346.3
[root@Tseng  ~]#

 2、创建文件夹,赋予777 权限

[root@Tseng ~]# cd /data/
[root@Tseng  data]# mkdir jenkins_home
[root@Tseng  data]# chmod 777 jenkins_home
[root@Tseng  data]#

3、查看密码

[root@Tseng ~]# cat /data/jenkins_home/secrets/initialAdminPassword
f2487112b84546a691e1f187fcbd4398
[root@Tseng ~]#

 4、开始配置,访问  http://   IP  :1581/

5、选择 安装推荐的插件  

6、等待 新手入门,页面完成,提示安装失败,暂停操作。修改服务器中相关配置信息

        6.1、替换插件安装下载源地址为清华园地址,选择Jenkins对应的版本

<url>https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/dynamic-2.346/update-center.json</url>

[root@Tseng ~]# cd /data/jenkins_home/
[root@Tseng jenkins_home]# ls
config.xml               hudson.model.UpdateCenter.xml  jenkins.install.InstallUtil.installingPlugins  jobs              nodes    secret.key                secrets  userContent  war
copy_reference_file.log  identity.key.enc               jenkins.telemetry.Correlator.xml               nodeMonitors.xml  plugins  secret.key.not-so-secret  updates  users
[root@Tseng jenkins_home]# vim hudson.model.UpdateCenter.xml 
[root@Tseng jenkins_home]# cat hudson.model.UpdateCenter.xml 
<?xml version='1.1' encoding='UTF-8'?>
<sites><site><id>default</id><url>https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/dynamic-2.346/update-center.json</url></site>
</sites>
[root@Tseng jenkins_home]#

        6.2、替换 default.json 文件

[root@Tseng jenkins_home]# cd updates/
[root@Tseng updates]# ls
default.json  hudson.tasks.Maven.MavenInstaller
[root@Tseng updates]# cp default.json default.json.bak
[root@Tseng updates]# ls
default.json  default.json.bak  hudson.tasks.Maven.MavenInstaller
[root@Tseng updates]# rm -rf default.json
[root@Tseng updates]# wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/dynamic-2.346/update-center.json
--2024-12-11 11:01:22--  https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/dynamic-2.346/update-center.json
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2756915 (2.6M) [application/json]
Saving to: ‘update-center.json’update-center.json                                 100%[===============================================================================================================>]   2.63M  --.-KB/s    in 0.04s   2024-12-11 11:01:23 (73.2 MB/s) - ‘update-center.json’ saved [2756915/2756915][root@Tseng updates]# ls
default.json.bak  hudson.tasks.Maven.MavenInstaller  update-center.json
[root@Tseng updates]# mv update-center.json default.json
[root@Tseng updates]# vim default.json
[root@Tseng updates]#

        6.3. 重启jenkins容器

[root@Tseng updates]# docker restart jenkins
jenkins
[root@Tseng updates]#

7、回到浏览器,重新安装插件,重新登录后,在安装失败页面选择后退,重新点击推荐安装

8、安装完成后,选择使用admin账户继续 

9、保存并完成 

 10、开始使用Jenkins

11、 在系统管理页面,如提示插件不匹配和部分菜单未汉化问题,重启Jenkins容器即可

http://www.lryc.cn/news/501968.html

相关文章:

  • 【OpenCV】模板匹配
  • 黑马商城微服务复习(5)
  • 云原生基础设施指南:精通 Kubernetes 核心与高级用法
  • 人工智能概要
  • qt QCommandLineParser详解
  • 力扣 K个一组翻转链表
  • cnocr配置及训练测试
  • 解决 Flutter 在 Mac 上的编译错误
  • MR30分布式IO在新能源领域加氢站的应用
  • wxPython中wx.ListCtrl用法(二)
  • kubernetes 资源汇总
  • 每日一题(对标gesp三级答案将在第二天公布)
  • 让 Win10 上网本 Debug 模式 QUDPSocket 信号槽 收发不丢包的方法总结
  • Python爬虫之使用BeautifulSoup进行HTML Document文档的解析
  • vue.config.js配置参数说明新手教程
  • C# 关于加密技术以及应用(二)
  • 视频中的某些片段如何制作GIF表情包?
  • 图像识别 | Matlab基于卷积神经网络(CNN)的宝可梦识别源程序,GUI界面。附详细的运行说明。
  • String【Redis对象篇】
  • top命令和系统负载
  • ES6 混合 ES5学习记录
  • HTTP 状态码大全
  • Redis学习(13)| Redisson 看门狗机制深度解析
  • 【开源大屏】玩转开源积木BI,从0到1设计一个大屏
  • 基于PCRLB的CMIMO雷达资源调度方法(MATLAB实现)
  • PAT--1035 插入与归并
  • Ubuntu20.04.6编译OpenWRT23.05.5错误
  • 一文说清flink从编码到部署上线
  • 【5G】5G Physical Layer物理层(一)
  • GauHuman阅读笔记【3D Human Modelling】