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

Align containerizingMode with Spring's Class Data Sharing (CDS) approach #4271

Open
wleese opened this issue Jun 10, 2024 · 0 comments
Open

Comments

@wleese
Copy link

wleese commented Jun 10, 2024

Environment:

  • Jib version: 3.4.3
  • Build tool: Maven 3.9.7
  • OS: Linux

Description of the issue:

While getting CDS to work with containerizingMode packaged & jib works, I'm left wondering if CDS is set up as good as can be. I'm in doubt, because there's still wildcard usage on the classpath.

I'm wondering if this plugin shouldn't align with what Spring describes.
https://docs.spring.io/spring-boot/reference/deployment/efficient.html#deployment.efficient

java -Djarmode=tools -jar my-app.jar extract

# app startup, no classpath specified
java -jar my-app/my-app.jar

This results in a directory/file layout like so:

./cdstestng-app-1.jar
./lib
./lib/exporter-trace-0.29.0.jar
./lib/opentelemetry-api-incubator-1.37.0-alpha.jar
[more libs]

Expected behavior:

I'd expect jib-maven-plugin to offer a containerizingMode that aligns with the way Spring recommends containerizing applications when using CDS. If for whatever reason such a mode shall not be provided, I'd expect some kind of documentation acknowledging the situation and explaining jib-maven-plugin's preferred to support CDS usage.

I read https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#i-want-to-containerize-a-jar ->

The intention of Jib is to add individual class files, resources, and dependency JARs into the container instead of
putting a JAR. This lets Jib choose an opinionated, optimal layout for the application on the container image, which
also allows it to skip the extra JAR-packaging step.

.. which I /think/ does not conflict with what Spring is advising.

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

No branches or pull requests

2 participants