I would like to run Jenkins in a Docker on Linux. Looks pretty simple.
I will have several remote agents running on different platforms. The issue I see is that one of my remote platforms does not support anything after JDK8. Is there a way I run an agent under JDK8 that will talk to a Jenkins controller running the latest Jenkins?
Any help/suggestions appreciated…except for upgrading the remote system to a newer Java…it is simply not possible.
Short answer: No, a Java 11 controller does not support Java 8 agents
Jenkins controllers require Java 11 or Java 17. Jenkins agents connected to those controllers require the same Java major version as the controller. The Jenkins controller sends Java classes to the agent for execution. Java 11 controllers send Java 11 classes to the agent. Java 8 agents are unable to execute the Java 11 classes sent by the Java 11 controller.
Alternatives include:
Create an agent on a platform that supports Java 11 and configure jobs to use that agent to run tasks on the target platform. That’s a technique that can work with devices that don’t support Java at all and with devices that don’t support a new enough Java version. It is not as easy as agents directly on the target platform, but it works
Remain with Jenkins LTS 2.346.3 or Jenkins weekly 2.356, the last versions that support Java 8. Accept that you’re running a version that does not receive security updates and is increasingly an “orphan” as plugins drop support for Java 8
Remain with Jenkins LTS 2.346.3 or Jenkins weekly 2.356, the last versions that support Java 8. Accept that you’re running a version that does not receive security updates and is increasingly an “orphan” as plugins drop support for Java 8
No security updates is ok as we are in an isolated secure environment. I tried what I though was an older docker version of Jenkins (alpine?) that supported JDK 8, but when it tried to do the initial plugin setup there were issues with plugin versions (as you predict, I think). Does that surprise you (maybe I did something wrong)?
I’d expect the container image jenkins/jenkins:2.346.3-2 and its similarly named containers to be well behaved with Java 8. If you want a reference that used that version, refer to the history of the lts-with-plugins branch in my docker-lfs repository.
Commits that might be of interest (as possible starting points):
Ok, I pulled the 2.346.3-2 image you recommended and am did some basic setup. I have successfully started an agent on the system with JDK 8, so all should be well.