Files
java-devops-demo/jib/scripts/05-reproducible.sh
T
Ankur MhatreandClaude Sonnet 5.5 bb12eaca0a 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
2026-12-01 08:32:09 +05:30

19 lines
815 B
Bash
Executable File

#!/usr/bin/env bash
# Two builds of the same sources produce the same image digest.
source "$(dirname "$0")/lib.sh"
{
banner "jib:buildTar twice, compare the image digest and id"
for n in 1 2; do
"${MVN[@]}" -q clean compile jib:buildTar "${BASE_ARG[@]}" >/dev/null 2>&1
echo "build $n digest=$(cat target/jib-image.digest) id=$(cat target/jib-image.id)"
sha256sum target/jib-image.tar | cut -c1-20 | sed "s/^/build $n tar sha256 prefix=/"
sleep 2
done
banner "Same build with creationTime=USE_CURRENT_TIMESTAMP"
for n in 1 2; do
"${MVN[@]}" -q clean compile jib:buildTar "${BASE_ARG[@]}" -Djib.container.creationTime=USE_CURRENT_TIMESTAMP >/dev/null 2>&1
echo "build $n digest=$(cat target/jib-image.digest)"
sleep 2
done
} 2>&1 | clean | tee "$OUT/05-reproducible.txt"