Add jib: Spring Boot 4.2.0 images with Jib 3.5.2 vs Buildpacks

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
This commit is contained in:
Ankur Mhatre
2026-12-01 08:32:09 +05:30
co-authored by Claude Sonnet 5.5
parent ddc3ec9d90
commit bb12eaca0a
30 changed files with 744 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# jib:dockerBuild, then look inside the result.
source "$(dirname "$0")/lib.sh"
{
banner "mvn jib:dockerBuild"
echo '$ mvn jib:dockerBuild'"${JIB_BASE:+ -Djib.from.image=$JIB_BASE}"
"${MVN[@]}" jib:dockerBuild "${BASE_ARG[@]}" 2>&1 | sed -n '/--- jib:/,$p' | grep -v 'Finished at' | grep -E 'Containerizing|Building|entrypoint|Built image|BUILD|Total time'
banner "Image config"
docker image inspect jib-demo:1.0.0 --format 'tags={{.RepoTags}}
user={{.Config.User}}
created={{.Created}}
exposed={{.Config.ExposedPorts}}
entrypoint={{json .Config.Entrypoint}}
layers={{len .RootFS.Layers}}
size={{.Size}} bytes'
banner "Layers Jib added on top of the base image"
docker history jib-demo:1.0.0 --no-trunc --format '{{.Size}} {{.CreatedBy}}' | grep jib-maven-plugin
banner "What is inside /app (no fat jar)"
docker run --rm --entrypoint sh jib-demo:1.0.0 -c 'ls -1 /app; echo; ls /app/libs | head -5; echo "... $(ls /app/libs | wc -l) jars in /app/libs"; echo; ls /app/classes /app/resources; echo; cat /etc/motd.txt; echo; cat /app/jib-classpath-file | tr ":" "\n" | head -3'
} 2>&1 | clean | tee "$OUT/02-jib-build.txt"