build(docker): add multi-stage distroless image and ci verification - #143
Merged
Conversation
added 2 commits
June 16, 2026 09:03
Add a root Dockerfile with a temurin 21 builder stage that produces the ledger bootJar and a gcr.io/distroless/java21-debian12:nonroot runtime stage carrying only the jar, running rootless on port 8080. Add a docker ci job that builds the image and asserts the two named stages, the nonroot user, an under-300mb size, a runnable smoke (spring boot starts under java 21), and a trivy image scan with no critical findings. The existing build-test and security jobs are unchanged. Closes #63
The new distroless image trivy gate found 4 critical cves in the boot 3.5.2 dependency tree: tomcat-embed-core 10.1.42 (CVE-2026-41293, CVE-2026-43512, CVE-2026-43515) and spring-security-web 6.5.1 (CVE-2026-22732). Boot 3.5.15 brings tomcat 10.1.55 and spring-security 6.5.11, clearing all four. Local test/detekt/spotless green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First slice of the E-01 ops cluster. Adds a container image for the ledger service.
Dockerfile, two named stages:builder(eclipse-temurin:21-jdk, builds the bootJar via the gradle wrapper, tests excluded - ITs need Postgres and run inbuild-test) andruntime(gcr.io/distroless/java21-debian12:nonroot, carries only the jar, rootless,EXPOSE 8080,ENTRYPOINT ["java","-jar","/app/app.jar"]).find ... ! -name '*-plain.jar'so the Spring Boot plain jar never collides with the executable jar.dockerCI job (needsbuild-test): builds the image and verifies every AC - two stages + distroless base, nonroot user (docker inspect), size < 300 MB, a runnable smoke (Starting LedgerApplicationunder java 21, full boot deferred to docker-compose ledger smoke test (healthy < 30s) #66 compose), and a Trivy image scan for CRITICAL (ECR DB mirror, no push).Notes
build-testandlint-security(filesystem Trivy + sarif guard) are untouched.Gate chain: analyst spec, architect plan, critic GO-WITH-CHANGES (3 changes folded in: fail-on-grep-miss smoke, plain-jar-independent copy, explicit Trivy ECR env).
Closes #63