#!/usr/bin/env bash # The same app through spring-boot:build-image (Cloud Native Buildpacks). # Needs -Pcorp-proxy in the sandbox where the post was written, because the builder container has to # reach github.com through a TLS-intercepting proxy. On an open network drop the PROFILE line. source "$(dirname "$0")/lib.sh" LOG=/tmp/bp-build.log START=$(date +%s) "${MVN[@]}" spring-boot:build-image -Dspring-boot.build-image.cleanCache=true "${BP_ARGS[@]}" >"$LOG" 2>&1 || { tail -30 "$LOG"; exit 1; } END=$(date +%s) { banner "mvn spring-boot:build-image (cold build: cleanCache=true; key lines of the build log)" grep -E 'Building image|Using builder|\[creator\] +(Paketo Buildpack for (BellSoft|Spring Boot|Executable|CA|Syft|Java|Apache)|BellSoft Liberica JRE [0-9.]+: |Using Java version|Downloading from)|Adding layer|Successfully built|BUILD|Total time' "$LOG" | sed -E 's/^\[INFO\] +\[creator\] +/ /' | grep -v 'Finished at' banner "Image config" docker image inspect jib-demo:buildpacks --format 'tags={{.RepoTags}} user={{.Config.User}} created={{.Created}} entrypoint={{json .Config.Entrypoint}} layers={{len .RootFS.Layers}} size={{.Size}} bytes' banner "Wall time of this build (seconds, indicative)" echo "$((END-START))" } 2>&1 | clean | tee "$OUT/06-buildpacks.txt"