# Jenkins plugins update

**URL:** <https://community.jenkins.io/t/jenkins-plugins-update/15469>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [May 26, 2024, 7:38pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469 "2024-05-26T19:38:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [May 26, 2024, 7:38pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/1 "2024-05-26T19:38:22Z")

</div>

Hi , I ran docker jenkins and tried to excute:  
docker cp /your/path/to/plugins.txt \<container\_name\>:/tmp/plugins.txt  
docker exec -it \<container\_name\> /bin/bash  
jenkins-plugin-cli --plugin-file /tmp/plugins.txt --plugins delivery-pipeline-plugin:1.3.2 deployit-plugin  
cp -r -p /usr/share/jenkins/ref/plugins/. /var/jenkins\_home/plugins/.  
exit as in [GitHub - jenkinsci/plugin-installation-manager-tool: Plugin Manager CLI tool for Jenkins](https://github.com/jenkinsci/plugin-installation-manager-tool)  
,when I ran jenkins-plugin-cli --plugin-file /tmp/plugins.txt --plugins delivery-pipeline-plugin:1.3.2 deployit-plugin  
. it showed to me the following msg:  
Plugin configuration-as-code:1775.v810dc950b\_514 unable to find dependant plugin json-api in update center [https://updates.jenkins.io/update-center.actual.json](https://updates.jenkins.io/update-center.actual.json)

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [May 27, 2024, 3:51am UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/2 "2024-05-27T03:51:03Z")

</div>

I’m not able to duplicate the problem based on your description.

Steps that I took while trying to duplicate the problem:

1. Define the list of plugins that I use in a [plugins.txt file](https://github.com/MarkEWaite/docker-lfs/blob/c51ff4faa2ac16894e969aa5176ed579565e06f7/plugins.txt#L1). Since you didn’t include the definition of your plugins.txt file, I used mine
2. Create a shell script that runs Jenkins 2.452.1 after downloading the files defined in my plugins.txt file and the `delivery-pipeline-plugin:1.3.2 deployit-plugin` plugins that you mentioned on your command line
3. Run the shell script, confirm that Jenkins 2.452.1 starts as expected and that the plugins were loaded as expected

My plugins.txt file includes the most recent release of the configuration as code plugin, `1810.v9b_c30a_249a_4c`, while yours must include `1775.v810dc950b_514` from 4 months ago since that is the version mentioned in the message. I’ve not attempted to duplicate your configuration with that older release of the configuration as code plugin. You’ll need to provide the contents of your `plugins.txt` file or update the versions in your `plugins.txt` file to the most recent releases.

The shell script that I used looks like this:

```bash
#!/bin/bash

# Jenkins plugin update fails with report that json-api cannot be found
#
# https://community.jenkins.io/t/jenkins-plugins-update/15469

JENKINS_WAR_VER=2.452.1
JENKINS_WAR=jenkins-${JENKINS_WAR_VER}.war
PLUGIN_MANAGER_VER=2.13.0
PLUGIN_MANAGER_JAR=jenkins-plugin-manager-${PLUGIN_MANAGER_VER}.jar

if [! -f ../$PLUGIN_MANAGER_JAR]; then
  base=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download
  wget ${base}/${PLUGIN_MANAGER_VER}/$PLUGIN_MANAGER_JAR
  mv $PLUGIN_MANAGER_JAR ..
fi
if [! -d plugins]; then
  mkdir plugins
fi
java -jar ../$PLUGIN_MANAGER_JAR \
     --jenkins-version $JENKINS_WAR_VER \
     --plugin-download-directory plugins \
     --plugin-file plugins.txt \
     --plugins delivery-pipeline-plugin:1.3.2 deployit-plugin

if [! -f ../$JENKINS_WAR]; then
  base=https://get.jenkins.io/war-stable
  wget ${base}/${JENKINS_WAR_VER}/jenkins.war
  mv jenkins.war ../$JENKINS_WAR
fi

JENKINS_HOME=. java -jar ../$JENKINS_WAR

```

## Other observations

Your script seems to be changing the plugins from inside the running container. That is not the preferred way to update plugins when using a container image. It is much more difficult to recreate the container and its plugin configuration when plugin updates are performed within the container.

Installing a 5 year old version of delivery pipeline plugin is surprising when there is a newer version that was released only 4 years ago.

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [May 27, 2024, 11:54am UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/3 "2024-05-27T11:54:31Z")

</div>

ok thank you sir.  
what about jenkins\_war . I ran docker container jenkins where the jenkins\_war directory is existed inside container at /usr/share/jenkins/jenkins.war

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [May 27, 2024, 12:12pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/4 "2024-05-27T12:12:44Z")

</div>

> [@arafata](#):
>
> what about jenkins\_war

I assume you are asking if you should update the version of the Jenkins war file from inside the container. If that is your question, then the answer is “no”.

When the Jenkins project delivers a new Jenkins release, we also deliver a [new tag](https://hub.docker.com/r/jenkins/jenkins/tags) for the container images that matches the release. Upgrades from one Jenkins version to the next are performed by changing the label of the container used in the `FROM` statement, not by replacing files inside an existing container image.

Many different examples are available of Dockerfiles using that pattern. For example:

- [Jenkins installation instructions](https://www.jenkins.io/doc/book/installing/docker/) for Docker
- [Build a Java app with Maven tutorial](https://www.jenkins.io/doc/tutorials/build-a-java-app-with-maven/#start-your-jenkins-instance)
- [Build a React app with NodeJS tutorial](https://www.jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/)
- [Build a Python app tutorial](https://www.jenkins.io/doc/tutorials/build-a-python-app-with-pyinstaller/)
- [Jenkins LTS with Java 21](https://github.com/MarkEWaite/docker-lfs/blob/a8eeb59e68279c0a3ee9d0cfc514ae9fb823ffaf/Dockerfile-jdk21)

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [May 27, 2024, 12:29pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/5 "2024-05-27T12:29:47Z")

</div>

thank u sir.  
I use the following :  
docker exec -it jenkins /bin/bash  
cd /usr/share/jenkins  
mv jenkins.war jenkins.war.old  
wget [https://updates.jenkins-ci.org/latest/jenkins.war](https://updates.jenkins-ci.org/latest/jenkins.war)

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [May 27, 2024, 1:02pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/6 "2024-05-27T13:02:52Z")

</div>

> [@arafata](#):
>
> docker exec -it jenkins /bin/bash  
> cd /usr/share/jenkins  
> mv jenkins.war jenkins.war.old  
> wget [https://updates.jenkins-ci.org/latest/jenkins.war](https://updates.jenkins-ci.org/latest/jenkins.war)

It is a mistake to replace the `jenkins.war` file inside the container image like that. That replacement technique makes it more difficult for you to manage the container in the future.

Container image definitions are usually tracked as code in a source code repository with a Dockerfile. When you update the Jenkins version inside a running container like that, you cause [“configuration drift”](https://www.puppet.com/blog/configuration-drift) where the Dockerfile that was used to create the container no longer represents the running container.

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [May 27, 2024, 6:43pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/8 "2024-05-27T18:43:44Z")

</div>

update Jenkins.war and plugins  
when I launch Jenkins container , can I bind mount volume as :  
volumes:

- /usr/share/Jenkins/jenkins.war:/usr/share/Jenkins/jenkins.war
- jenkins\_home:/var/jenkins\_home:rw # Workspace home  
then to update Jenkins container from outside use your code but update directory of Jenkins.war and plugin

> **update jenkins.war and plugins**
>
> #!/bin/bash
> 
> # 
> 
> JENKINS\_WAR\_VER=2.452.1  
> JENKINS\_WAR=/usr/share/Jenkins/jenkins-{JENKINS\_WAR\_VER}.war PLUGIN\_MANAGER\_VER=2.13.0 PLUGIN\_MANAGER\_JAR=jenkins-plugin-manager-{PLUGIN\_MANAGER\_VER}.jar
> 
> if [! -f ../PLUGIN\_MANAGER\_JAR]; then base=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download wget {base}/${PLUGIN\_MANAGER\_VER}/$PLUGIN\_MANAGER\_JAR  
> mv $PLUGIN\_MANAGER\_JAR ..  
> fi  
> if [! -d plugins]; then  
> mkdir plugins  
> fi  
> java -jar ../$PLUGIN\_MANAGER\_JAR   
> –jenkins-version $JENKINS\_WAR\_VER   
> –plugin-download-directory /var/jenkins\_home/plugins   
> –plugin-file plugins.txt   
> –plugins delivery-pipeline-plugin:1.3.2 deployit-plugin
> 
> if [! -f ../JENKINS\_WAR]; then base=https://get.jenkins.io/war-stable wget {base}/${JENKINS\_WAR\_VER}/jenkins.war  
> mv jenkins.war ../$JENKINS\_WAR  
> fi
> 
> JENKINS\_HOME=. java -jar ../$JENKINS\_WA

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [May 28, 2024, 5:44am UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/9 "2024-05-28T05:44:25Z")

</div>

The idea of the docker container is that it is fixed with respect to jenkins version and installed plugins. So in case you want to update jenkins and/or plugins you create a new docker image.  
With your approach a docker container is not required at all.

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [May 28, 2024, 11:29am UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/10 "2024-05-28T11:29:00Z")

</div>

you mean that I can’t update container

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [May 28, 2024, 11:56am UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/11 "2024-05-28T11:56:53Z")

</div>

Why have a container just to replace the things are a burnt into the image at startup?  
So you can do it in the way you do it right now, but you don’t need a docker container for this. It might be easier to understand what is going on when you do it without a container.

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [May 28, 2024, 2:34pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/12 "2024-05-28T14:34:17Z")

</div>

ok , what about the Image I have or downloaded from docker hub is need to update , and there is no recent releases of that image

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [May 31, 2024, 11:59pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/13 "2024-05-31T23:59:48Z")

</div>

> [@arafata](#):
>
> there is no recent releases of that image

Choose a base container image that is being updated regularly. If the base container image you are using is not regularly updated, then it is time to change to an image that is updated regularly.

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [June 3, 2024, 1:21pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/14 "2024-06-03T13:21:04Z")

</div>

> [@MarkEWaite](#):
>
> Choose a base container image that is being updated regularly. If the base container image you are using is not regularly updated, then it is time to change to an image that is updated regularly.

Ok thank you Sir . what is the suitable image jenkins for continous integrration

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [June 3, 2024, 2:00pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/15 "2024-06-03T14:00:27Z")

</div>

> [@arafata](#):
>
> what is the suitable image jenkins for continous integrration

The [Jenkins installation instructions for Docker](https://www.jenkins.io/doc/book/installing/docker/) and the Jenkins tutorials that are based on Docker ([Apache Maven](https://www.jenkins.io/doc/tutorials/build-a-java-app-with-maven/), [React and NodeJS](https://www.jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/), and [Python](https://www.jenkins.io/doc/tutorials/build-a-python-app-with-pyinstaller/)) all use the [jenkins/jenkins container image on DockerHub](https://hub.docker.com/r/jenkins/jenkins).

The [dependabot tool from GitHub](https://docs.github.com/en/code-security/dependabot) can be configured to periodically propose pull requests to update the container version in a GitHub repository. That reduces the overhead of managing container versions. Examples are available in the [Jenkins docker repository](https://github.com/jenkinsci/docker/blob/6c8a57bc606ac03a3fba11d0b8f0a805c83cbbfe/.github/dependabot.yml).

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [June 3, 2024, 5:09pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/16 "2024-06-03T17:09:38Z")

</div>

thank u sir, but there is no caching for image layers when Rebuilding an image using jenkins/jenkins container through continous integration , I need to build image from [jenkins](https://github.com/jenkinsci/jenkins) or ([GitHub - jenkinsci/blueocean-plugin: Blue Ocean is a reboot of the Jenkins CI/CD User Experience](https://github.com/jenkinsci/blueocean-plugin)) . then launching a container jenkins for continous integration

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [June 3, 2024, 5:35pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/17 "2024-06-03T17:35:35Z")

</div>

> [@arafata](#):
>
> there is no caching for image layers when Rebuilding an image using jenkins/jenkins container through continuous integration

That sounds like a problem in the environment where you are building containers. You’ll want to fix that problem, not avoid the problem by taking full responsibility for the entire definition of the container image.

> [@arafata](#):
>
> I need to build image from [jenkins](https://github.com/jenkinsci/jenkins) or ([GitHub - jenkinsci/blueocean-plugin: Blue Ocean is a reboot of the Jenkins CI/CD User Experience](https://github.com/jenkinsci/blueocean-plugin)) . then launching a container jenkins for continuous integration

If you truly must build a container image from the Jenkins war file, then you should refer to the Dockerfile definitions in the [GItHub repository](https://github.com/jenkinsci/docker) where the Jenkins project stores the container definitions for Jenkins controllers. That repository contains the results of years of learning about container builds and container maintenance.

I think it is unwise to recreate something at a lower level (build a container from the Jenkins war file) when you can reuse something that is already defined at a higher level (container that already includes the Jenkins war file, includes plugin management facilities, includes support for configuration as code, and more).

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [June 3, 2024, 6:24pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/18 "2024-06-03T18:24:01Z")

</div>

Ok thank you sir for your clarification, do you mean that jenkins/jenkins container is able to cache the builded image layers when you need to use caching for rebuilding that image

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [June 3, 2024, 6:51pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/19 "2024-06-03T18:51:41Z")

</div>

> [@arafata](#):
>
> do you mean that jenkins/jenkins container is able to cache the builded image layers when you need to use caching for rebuilding that image

Caching image layers is a task of the `docker` command that builds the container image. It is not something that the container definition controls. If your CI environment does not cache image layers, that is something to fix in your CI environment.

---

<div class="post-metadata">

**Author:** ![arafata](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@arafata](https://community.jenkins.io/u/arafata)\
**Post date:** [June 3, 2024, 7:09pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/20 "2024-06-03T19:09:30Z")

</div>

jenkinsci/blueocean is adjusted to access docker binary and it can cache when rebuilding docker images and there are many additions to official jenkins/jenkins , and these additions require experience

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [June 3, 2024, 7:48pm UTC](https://community.jenkins.io/t/jenkins-plugins-update/15469/21 "2024-06-03T19:48:33Z")

</div>

> [@arafata](#):
>
> jenkinsci/blueocean is adjusted to access docker binary and it can cache when rebuilding docker images and there are many additions to official jenkins/jenkins

The [`jenkinsci/blueocean` container image](https://hub.docker.com/r/jenkinsci/blueocean) is no longer maintained. It has not been updated in over two years. It uses an end of life Alpine 3.16.2 operating system as its base image and includes Jenkins version 2.346.3 with known critical security vulnerabilities. It only supports amd64 platforms.

The [`jenkins/jenkins` container image](https://hub.docker.com/r/jenkins/jenkins/tags) is actively maintained. It uses current operating system versions as its base. It can be configured to have all the features that were available in the `jenkinsci/blueocean` container image plus many more. It supports amd64, aarch64, s390x, and ppc64le platforms.

[Next page](https://community.jenkins.io/t/jenkins-plugins-update/15469.md?page=2)
