当前位置:网站首页>Jenkins 镜像无法更新插件中心的3种解决方法
Jenkins 镜像无法更新插件中心的3种解决方法
2022-06-24 15:33:00 【独家雨天】
在通过Docker 镜像安装Jenkins的情况下,每次都会碰到在Jenkins插件无法安装的情况,导致所有的插件安装失败。

通过 Docker logs 容器名 来查看实际运行的日志。例如,docker logs myjenkins -f 来时实的输出myjenkins容器的日志, 提示如下:
Caused: java.io.IOException: Failed to load http://updates.jenkins-ci.org/download/plugins/antisamy-markup-formatter/1.6/antisamy-markup-formatter.hpi to /var/jenkins_home/plugins/antisamy-markup-formatter.jpi.tmp
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1217)
Caused: java.io.IOException: Failed to download from http://updates.jenkins-ci.org/download/plugins/antisamy-markup-formatter/1.6/antisamy-markup-formatter.hpi (redirected to: http://mirrors.jenkins-ci.org/plugins/antisamy-markup-formatter/1.6/antisamy-markup-formatter.hpi)
意思就是,docker 容器无法从 http://updates.jenkins-ci.org/download/plugins/ 链接处下载Jenkin 插件。
通过Jenkins 的 Github 可以看到(链接 jenkinsci/docker) ,官方提供了设置来让我们设置插件中心。
对于Jenkin插件中心设置,主要相关的几个Docker容器环境变量说明如下:
JENKINS_UC:主要的插件更新中心,会提供Jenkin 长期支持的版本。默认值就是 https://updates.jenkins.io.JENKINS_UC_EXPERIMENTAL:主要的插件开发/实验版本更新中心。JENKINS_UC_DOWNLOAD:从插件更新中心的下载链接,默认为$JENKINS_UC/downloads。
方案一:所以,很多用户,为了解决这个问题,会自己重新打一个Jenkins Images,然后覆盖这个 JENKINS_UC_DOWNLOAD 参数,或者在启动容器的时候, 重载这个 JENKINS_UC_DOWNLOAD 参数。
本人未试过,但是此法应该是可行的。(主要是懒不想这么做,因为大部分的安装都已经做完了,不想重新来一遍,所以主要试了如下的方案)
方案二:以root的用户进入容器,然后更新镜像源。等待更新完成,通常能够解决网络Jenkins插件中心网络不可达的问题。
docker exec -it -u root myjenkins bash
apt-get update
方案三: (推荐)在插件安装界面先继续,注册完Admin账户后登录,在 jenkins --> Manage Jenkins --> Manage Plugins --> Advanced 的选项中选中更新Update Site。 将更新源重 https://updates.jenkins-ci.org/update-center.json 替换成 http://mirror.esuni.jp/jenkins/updates/update-center.json。注意替换后的没有(https)。

上面方法尝试完之后,可以在 Jenkins -> Update Center看到如下成功的界面:

虽然还是会有些许插件无法正常更新,但是已经无妨了。
参考文档:
边栏推荐
- Two way combination of business and technology to build a bank data security management system
- Carry forward the fine style of continuous operation and go all out to ensure the safety of Beijiang Levee
- How to efficiently transfer enterprise business data?
- Golang实现Biginteger大数计算
- Is it safe for futures companies to open accounts
- 缓存使用中Redis,Memcached的共性和差异分析
- Typescript raw data type
- Analysis of dompurify
- [sdx62] wcn685x IPA registration failure analysis and solution
- Service visibility and observability
猜你喜欢

List of PostgreSQL

As a developer, what is the most influential book for you?

国产最长寿的热销手机,苹果也不是对手,总算让国产手机找回面子

Wi-Fi 7 来啦,它到底有多强?

Stm32f1 and stm32cubeide programming examples -ws2812b full color LED driver (based on spi+dma)

刚刚阿里面软件测试回来,3+1面任职阿里P7,年薪28*15薪

CVPR 2022 - Interpretation of selected papers of meituan technical team

为什么企业实施WMS仓储管理系统很容易失败
![clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]](/img/f0/42f394dbc989d381387c7b953d2a39.jpg)
clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]
Record the range of data that MySQL update will lock
随机推荐
In 2021, big companies often ask IOS interview questions -- runloop
Concurrent writing of maps in golang
Very exciting! 12000 words summarized the theory of network technology, reviewing the old and learning the new
如何实现容器内的SqlServer的数据库迁移
兴业证券靠谱吗?开证券账户安全吗?
Cvpr2022 𞓜 thin domain adaptation
Two way combination of business and technology to build a bank data security management system
Istio practical skill: enable accesslog locally
The cold winter can't stop the determination to enter the big factory. The Android interview has a complete knowledge structure, and everything you need to master in the interview is here!
Domestic payment system and payment background construction
Which account of Dongfang fortune is safer and better
Is industrial securities reliable? Is it safe to open a securities account?
Design of CAN bus controller based on FPGA (Part 2)
MySQL replication series 6- tables related to replication information
Is it safe to open a stock account by mobile phone
Xingxinghai, it is said that the new generation can fight better?
How to build a high-performance go cache Library
The 30 pictures bring the network protocol layer by layer to life. It's really fragrant!
He is also a junior test engineer. Why is his salary high? The interview must be brilliant at these points
Task priority motion planning of floating base