-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Way to exclude dependencies in the image or have right support for various forms of fat/shaded JARs #1852
Comments
I replied to #1851 and just saw your comment. The FAQ explains the current limitation of I think I'll open this issue, which asks for either having
Note this issue is not talking about runnable JARs (which are often fat). #530 is the issue for runnable JARs. |
It is best to avoid putting a fat JAR if possible, because it nullifies all the benefits of fine-grained layering by Jib that brings in fast iterations and caching. It'd be ideal if Jib could just use the original (non-fat) JAR. For Maven, Spring Boot leaves the original JAR in the build directory, so it seems not difficult for Jib to automatically detect Spring Boot and use the original JAR (fixed by #2170). For Gradle, we can enable the We may still introduce an option to not copy dependency JARs if we should really copy a fat JAR, but for now, it's worth implementing this auto-detection for Spring Boot. |
With new Jib versions, now Spring Boot projects with Anyways, I don't think we'll need to provide a general way to exclude adding dependencies into the image for the sake of being able to put a fat JAR (with However, for a potential feature for generalized fined-grained dependency control, see #1962 (comment) |
The Jib Extension Framework is now available with the latest Jib versions. You can easily extend and tailor the Jib plugins behavior to your liking. We've written a general-purpose layer-filter extension that enables fine-grained layer control, including deleting files and moving files into new layers. For general information about using and writing extensions, take a look at the Jib Extensions repo. |
Hi again,
When building with
containerizingMode = 'packaged'
, our dependencies are built into the jar archive. Is it possible to not add the dependencies to<appRoot>/libs
for a smaller image?The text was updated successfully, but these errors were encountered: