当前位置:网站首页>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看到如下成功的界面:

虽然还是会有些许插件无法正常更新,但是已经无妨了。
参考文档:
边栏推荐
- practice
- Service visibility and observability
- How do individuals open accounts for stock speculation? Is it safe to open accounts for stock speculation
- Tencent cloud native intelligent data Lake Conference will be held, revealing the panoramic matrix of Tencent cloud data Lake products for the first time
- Monitoring and warning | is the website attacked?
- Multimeter resistance measurement diagram and precautions
- 07. Tencent cloud IOT device side learning - Data Template
- SF express: please sign for MySQL soul ten
- CVPR2022 | 可精簡域適應
- Xingxinghai, it is said that the new generation can fight better?
猜你喜欢

为什么企业实施WMS仓储管理系统很容易失败
An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!

FreeRTOS新建任务不执行问题解决办法

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

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

还在担心漏测吗?快来使用jacoco统计下代码覆盖率

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

A brief introduction to the lexical analysis of PostgreSQL

Multimeter resistance measurement diagram and precautions
随机推荐
Since the household appliance industry has entered the era of stock competition, why does Suning win the first channel for consecutive times?
东方财富哪个开户更安全,更好点
Differential privacy
VNC Viewer方式的远程连接树莓派
[log service CLS] initial experience of Tencent cloud CLS log service
US Senate promotes bipartisan gun safety bill
Allwinner a40i industrial Internet gateway design scheme, smart site, smart city core gateway
Es search content top
In 2021, big companies often ask IOS interview questions -- runloop
Wide measuring range of jishili electrometer
还在担心漏测吗?快来使用jacoco统计下代码覆盖率
Huangchuping presided over the video conference on fixed-point contact with Zhuhai, resolutely implemented the deployment requirements of the provincial Party committee, and ensured positive results i
Chaos mesh in Tencent -- Tencent mutual entertainment chaotic engineering practice
Is industrial securities reliable? Is it safe to open a securities account?
Universal file online preview project, open source!
MySQL 开发规范
缓存使用中Redis,Memcached的共性和差异分析
Kubernetes practical tips: using ksniff to capture packets
openinstall携手书链:助力渠道数据分析,共创书联网时代
SF express: please sign for MySQL soul ten