Add docker-images: one Spring Boot 4 service packaged nine ways

Companion code for "Dockerizing Spring Boot 4: Layered Jars, Buildpacks,
Distroless and Image Size Benchmarks". Fat jar on JDK and JRE, layered jar
on Debian, Alpine and distroless, jlink, the JDK 25 AOT cache, Paketo
buildpacks and Jib, each measured for size on disk and pushed, rebuild
delta, startup, user and shell. Also PID 1 and signal handling, the jdeps
module gap, AOT cache mismatches and buildpacks memory calculation.
Transcripts in docs/output/, regenerated by scripts/run-all.sh.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C3TETMrqVUWeFkNtz3Jbo3
This commit is contained in:
2026-09-11 17:11:46 +00:00
co-authored by Claude Opus 5
parent 86246dc860
commit 644da9e65e
52 changed files with 1308 additions and 1 deletions
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Where the buildpacks image's size goes, and why its JRE is bigger than Temurin's.
# -> docs/output/buildpacks-layers.txt
set -uo pipefail
source "$(dirname "$0")/env.sh"
W=$(mktemp -d)
{
echo "# docker history sbd/docker-images:buildpacks"
docker history --no-trunc --format '{{.Size}}\t{{.CreatedBy}}' sbd/docker-images:buildpacks | cut -c1-110
echo
cid=$(docker create sbd/docker-images:buildpacks); docker export "$cid" | tar -x -C "$W" layers/paketo-buildpacks_bellsoft-liberica/jre; docker rm "$cid" > /dev/null
cid=$(docker create eclipse-temurin:25-jre); docker export "$cid" | tar -x -C "$W" opt/java/openjdk; docker rm "$cid" > /dev/null
L="$W/layers/paketo-buildpacks_bellsoft-liberica/jre"; T="$W/opt/java/openjdk"
echo "# The two JREs, in MB (du -sm)"
printf '%-44s %6s\n' "BellSoft Liberica JRE (buildpacks) total" "$(du -sm "$L" | cut -f1)"
printf '%-44s %6s\n' " lib/server" "$(du -sm "$L/lib/server" | cut -f1)"
printf '%-44s %6s\n' " lib/client" "$(du -sm "$L/lib/client" | cut -f1)"
printf '%-44s %6s\n' "Temurin JRE (eclipse-temurin:25-jre) total" "$(du -sm "$T" | cut -f1)"
printf '%-44s %6s\n' " lib/server" "$(du -sm "$T/lib/server" | cut -f1)"
printf '%-44s %6s\n' " lib/client" "$( [ -d "$T/lib/client" ] && du -sm "$T/lib/client" | cut -f1 || echo absent)"
} | tee "$OUT/buildpacks-layers.txt"
rm -rf "$W"