Comments (1)
Ultimately, I achieved the desired result with the help of the following changes in the settings of the jib-maven-plugin plugin:
- add dependency to the plugin jib-layer-filter-extension-maven - this is for managing layers when creating an image:
<dependencies>
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-layer-filter-extension-maven</artifactId>
<version>0.3.0</version>
</dependency>
</dependencies>
- Add extraDirectories so that fat jar formed by spring boot is included to the image:
<extraDirectories>
<paths>
<path>
<from>target</from>
<into>/app/classpath</into>
<includes>*.jar</includes>
</path>
</paths>
</extraDirectories>
- Then in pluginExtensions we delete the old jar that created jib and delete libs, because all libs are in our fat jar from spring:
<pluginExtensions>
<pluginExtension>
<implementation>com.google.cloud.tools.jib.maven.extension.layerfilter.JibLayerFilterExtension</implementation>
<configuration implementation="com.google.cloud.tools.jib.maven.extension.layerfilter.Configuration">
<filters>
<filter>
<glob>/app/classpath/*.original.jar</glob>
</filter>
<filter>
<glob>/app/libs/*.jar</glob>
</filter>
</filters>
</configuration>
</pluginExtension>
</pluginExtensions>
- And we add the correct entry point of our jar for spring (if we have spring boot >= 3.2, then the class will be different org.springframework.boot.loader.launch.JarLauncher):
<entrypoint>java,-cp,@/app/jib-classpath-file,org.springframework.boot.loader.JarLauncher</entrypoint>
As a result, fat jar will simply lie in /app/classpath folder.
If you do everything through jib-cli, then instead of fat jar there will be an unpacked jar in the /app folder.
from jib.
Related Issues (20)
- Empty folders in the /app/resources directory slow down resource file scanning
- Jib Ubuntu and MacOS Continuous Builds are failing HOT 5
- Unauthorized error when Harbor redirects to official Docker Hub images HOT 2
- Automatically add standard oci annotations for base images
- Publish a release with #4204 HOT 3
- Upgrade ASM to 9.6 to support Java 22
- jvmFlags.add throws UnsupportedOperationException in gradle jib plugin
- Core Release v0.27.0-core
- Plugin Release v3.4.2-gradle
- Plugin Release v3.4.2-maven
- Jib CLI base image cache problem
- Jib CLI proxy usage not documented
- Some dependencies in jib-core are set to wrong dependency scope that may cause compilation error. HOT 3
- Jib 3.4.2 build fails HOT 22
- Jib MacOS Continuous job still experiencing failure with jetty
- Can't build multi arch images on M1 chips (Jib 3.4.1+) (Works on x64 chips) HOT 7
- Release jib cli v0.13.0 ? HOT 3
- CLI Release v0.13.0-cli
- Failing UP-TO-DATE checks for jib-gradle-plugin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jib.