Same app built both ways: layers, reproducible digest, extraDirectories, registry push without a daemon, wrong-JRE and missing-compile failures, Buildpacks memory calculator at 512 MB. Captured output in jib/output, regenerated by jib/scripts/run-all.sh. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
23 lines
1.5 KiB
Plaintext
23 lines
1.5 KiB
Plaintext
|
|
=== 1. jib:buildTar without compiling first (target/ was just cleaned) ===
|
|
$ mvn clean jib:buildTar
|
|
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.5.2:buildTar (default-cli) on project jib-demo: Obtaining project build output files failed; make sure you have compiled your project before trying to build the image. (Did you accidentally run "mvn clean jib:build" instead of "mvn clean compile jib:build"?): <module>/target/classes -> [Help 1]
|
|
|
|
=== 2. Base image older than the compiled bytecode (class files are Java 25, JRE is 21) ===
|
|
$ docker run jib-demo-wrongjre
|
|
Error: LinkageError occurred while loading main class com.ankurm.jibdemo.JibDemoApplication
|
|
java.lang.UnsupportedClassVersionError: com/ankurm/jibdemo/JibDemoApplication has been compiled by a more recent version of the Java Runtime (class file version 69.0), this version of the Java Runtime only recognizes class file versions up to 65.0
|
|
|
|
=== 3. Heap size at a 512 MB container limit: JVM default vs -XX:MaxRAMPercentage=75 ===
|
|
MaxRAMPercentage=25
|
|
size_t MaxHeapSize = 134217728 {product} {ergonomic}
|
|
MaxRAMPercentage=75
|
|
size_t MaxHeapSize = 402653184 {product} {ergonomic}
|
|
|
|
=== 4. containerizingMode=packaged after mvn package (Spring Boot repackaged the jar) ===
|
|
22327669 target/jib-demo-1.0.0.jar
|
|
4562 target/jib-demo-1.0.0.jar.original
|
|
$ docker run --rm --entrypoint ls -l /app/classpath
|
|
4562 jib-demo-1.0.0.original.jar
|
|
INFO 1 --- [jib-demo] [ main] com.ankurm.jibdemo.JibDemoApplication : Started JibDemoApplication in 2.697 seconds (process running for 3.013)
|