当前位置:网站首页>Three solutions for Jenkins image failing to update plug-in Center

Three solutions for Jenkins image failing to update plug-in Center

2022-06-24 15:39:00 Exclusive rainy days

stay adopt Docker Image mount Jenkins Under the circumstances , Every time I will meet you in Jenkins The plug-in cannot be installed , All plug-ins failed to install .

Jenkins Plug in installation failed

adopt Docker logs Container name To view the actual running log . for example ,docker logs myjenkins -f Real time output myjenkins Container log , The tips are as follows :

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)

It means ,docker The container cannot be removed from http://updates.jenkins-ci.org/download/plugins/ Download at link Jenkin plug-in unit .

adopt Jenkins Of Github You can see ( link jenkinsci/docker) , The official settings let us set up the plug-in Center .

about Jenkin Plug in center settings , Mainly related Docker The container environment variables are described as follows :

  • JENKINS_UC: The main plug-in Update Center , Would provide Jenkin Long term supported versions . The default value is https://updates.jenkins.io.
  • JENKINS_UC_EXPERIMENTAL: Major plug-in development / Experimental version update Center .
  • JENKINS_UC_DOWNLOAD: Download link from plug-in Update Center , The default is $JENKINS_UC/downloads.

Scheme 1 : therefore , A lot of users , To solve this problem , I will try again Jenkins Images, Then overwrite this JENKINS_UC_DOWNLOAD Parameters , Or when you start the container , Reload this JENKINS_UC_DOWNLOAD Parameters .

I have not tried , But this method should be feasible .( The main reason is that I am lazy and don't want to do this , Because most of the installation has been completed , I don't want to do it again , So I mainly tried the following scheme )

Option two : With root Of users entering the container , Then update the mirror source . Wait for the update to complete , It can usually solve the network problem Jenkins The plug-in center network is unreachable .

docker exec -it -u root myjenkins bash
apt-get update

Option three : ( recommend ) Continue in the plug-in installation interface , After registration Admin Login after account , stay jenkins --> Manage Jenkins --> Manage Plugins --> Advanced Select Update... In the options of Update Site. The source will be updated https://updates.jenkins-ci.org/update-center.json Replace with http://mirror.esuni.jp/jenkins/updates/update-center.json. Note that the replacement does not have (https).

Update Site Set up

After the above method is tried , Can be in Jenkins -> Update Center See the following successful interface :

 The updated effect

Although there are still some plug-ins that can not be updated normally , But it doesn't matter .

Reference documents :


  1. How can I get docker container root’s password - Stack Overflow
  2. Can’t download plugins from https://updates.jenkins.io/download/plugins/ with install-plugins.sh · Issue #594 · jenkinsci/docker
  3. 【Devops】【Jenkins】Jenkins Handling method of plug-in installation failure - Angel A squeeze - Blog Garden
  4. docker/README.md at master · jenkinsci/docker
原网站

版权声明
本文为[Exclusive rainy days]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241321403694.html