How to upgrade java11 to 17 in jenkins container?

Hello everyone,
I have a running jenkins container, it’s AIphine 3.16.2 and jenkins v2.461 with java openjdk11.
But JAVA11 EOL, I need to upgrade it to JAVA 17.

I don’t want to recreate a container, so can anybody teach me how to update java version when i in conainer?

Thanks a lot

In fact, the concept of applications in containers works the other way around: you simply update the container as the application versions change…

When you really want to stay with the old version of Alpine and Java then you should ask in the corresponding docker forums (but they might use the same arguments) . And when you are going to upgrade: please migrate to Java 21 as Java 17 EOL ist coming soon…

Hi, I solved it.
I download openjdk21 and copy it into container,then restart jenkins service.
Finally it success…

But there’s another question my jenkins container’s OS EOL too…

1 Like

Hello,
I upgrade jenkins,java and plugins successfule, am i need to upgrade agent’s version.
Or it will be error?

It’s always a good idea to keep the agents version in sync with what the controller bring. You get that automatically for ssh agents. For inbound agents you could run a curl upfront as shown on the agents page in Jenkins when it is not connected
E.g. for Linux

curl -sO http://localhost:9090/jnlpJars/agent.jar;java -jar agent.jar -url http://localhost:9090/ -secret 9374cf4d755e163c374e4ca021ab05bc16b54a153ec631f9df0798f8b9c94ac5 -name inbound -webSocket -workDir "/data/test"

or for windows

curl.exe -sO http://localhost:9090/jnlpJars/agent.jar & java -jar agent.jar -url http://localhost:9090/ -secret 9374cf4d755e163c374e4ca021ab05bc16b54a153ec631f9df0798f8b9c94ac5 -name inbound -webSocket -workDir "/data/test"
1 Like