Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lts-jdk17 image is missing jmods from the installed JDK #1988

Open
eric-creekside opened this issue Feb 15, 2025 · 2 comments
Open

lts-jdk17 image is missing jmods from the installed JDK #1988

eric-creekside opened this issue Feb 15, 2025 · 2 comments

Comments

@eric-creekside
Copy link

eric-creekside commented Feb 15, 2025

Jenkins and plugins versions report

Jenkins Docker image, tag jenkins/jenkins:lts-jdk17

What Operating System are you using (both controller, and any agents involved in the problem)?

Docker image

Reproduction steps

Running Jenkins in Docker using the jenkins/jenkins:lts-jdk17 image, I find that the OpenJDK installed in that image is missing the jmods directory. This directory and its contents are required for using the jpackage tool (which is included in the image, by the way). A build job that relies on running jpackage using standard location for the built-in Java library module definitions, will fail.
Is there perhaps a different location in the image where the jmod files are kept?

If I was a Docker expert I might even be able to update the image with a full JDK installation, but that's beyond the expertise of anyone on my team.

Expected Results

/opt/java/openjdk/jmods exists and contains all the appropriate .jmod files.
A job that uses jpackage and relies on the jmod files runs successfully.

Actual Results

jpackage jobs fail

Anything else?

No response

Are you interested in contributing a fix?

No response

@timja
Copy link
Member

timja commented Feb 15, 2025

Hi

Firstly, the controller image provided is always going to be minimal as jobs are intended to be run on agents, using e.g. the inbound or ssh agent image.

Even in those images the Java runtime is meant to be small to reduce the size that every user needs to pull whenever they need the image.

The best way forward would be for you to create your own image, either:

  • Adding another java install for your jpackage
  • re-installing a full version of Java as the default one
  • Your own base image which fetches the agent.jar file

@eric-creekside
Copy link
Author

I understand all of those points, but I contend that by including jpackage the image should also include the jmods, since without them jpackage isn't really useful for the most common cases (following the Principal of Least Surprise).
I guess you could respond with "OK, we'll strip jpackage from the base image." That's your prerogative it makes the built-in agent less useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants