Dockerize Java Securely: SBOMs + Attestations + Cosign
Containerizing Java applications is easy. Containerizing them securely is not. This talk shows how to strengthen Java Docker builds with SBOMs extracted at every stage of a multi-stage build, BuildKit attestations, OCI 1.1 referrers, Docker Hardened Images, and Cosign signing — told through the narrative of the Docker Commandos in Asgard.

Welcome to the Halloween edition of Dockerize Securely at BaselOne 2026, in the Markthalle Basel, Switzerland. The Black Forest Commandos are defending Asgard—and our Java container supply chains.
The companion article above contains the full story, Java Dockerfile, explanations, and security caveats. Use this page as a quick reference during the session.
TL;DR: SIP It Before You Ship It
Sandbox → Lock → Harden → Attest → Scan. Isolate agents, lock dependencies, use hardened multi-stage builds, generate attestations, and scan before promotion. Verify signatures before deployment.
Inspect an image
git clone https://github.com/ContainerSecurity-dev/dockerize-java-securely.git
cd dockerize-java-securely
# After the build steps in the linked runbook:
export IMAGE=127.0.0.1:15000/dockerize-java-securely:hardened
docker scout sbom "$IMAGE" --format list
docker scout cves --only-severity critical,high "$IMAGE"
Build with attestations
Use the sample repository and live-demo runbook to start the local registry and build from the provided Dockerfile. Use secret mounts for credentials; maximum-level provenance can expose build arguments.
docker login dhi.io
docker buildx build \
--platform linux/amd64 \
--metadata-file results/hardened-build-metadata.json \
--sbom=true \
--provenance=mode=max \
--push \
-t "$IMAGE" .
Scan and verify before promotion
Read the pushed digest from the build metadata. Verification requires the trusted public key and an image already signed using the runbook. The measured hardened sample still has 3 critical and 5 high Java findings, so the vulnerability gate is expected to return 1.
export DIGEST_IMAGE="127.0.0.1:15000/dockerize-java-securely@$(python3 -c 'import json; print(json.load(open("results/hardened-build-metadata.json"))["containerimage.digest"])')"
trivy image \
--scanners vuln \
--severity CRITICAL,HIGH \
--exit-code 1 "$DIGEST_IMAGE"
cosign verify --key .demo-keys/cosign.pub "$DIGEST_IMAGE"
Repositories and Hands-On Materials
-
Dockerize Java Securely — this talk's Spring Boot sample, baseline and hardened Dockerfiles, CLI runbook, and measured scan results.
-
Black Forest Commandos v1.5 — workshop code and mission exercises.
-
Commandos Labspace — materials for the Labspace workshop environment.
-
SIP Agent Skill — portable supply chain security instructions for coding agents.
-
Asgard Mission DIY guide — the longer, hands-on version of the mission.
More Articles
- Generating SBOM with Docker Scout — inspect and export software inventories.
- The Poisoned Macchiato — Java SBOM attestations, Cosign, and OCI artifacts.
- Docker Hardened Images are Free — hardened base images and vulnerability comparisons.
- The Shai-Hulud Family — how modern supply chain worms spread.
- Docker Sandbox Kits: A Hands-On Tutorial — agent isolation and capability controls.
- SIP: Five Immediate Software Supply Chain Controls — the full five-control implementation.
Meet the Commandos in My Books
- Docker and Kubernetes Security — a practical guide to software supply chains, CI/CD, Kubernetes hardening, and runtime security.
- Black Forest Shadow — the origin story of Gord, Rothütle, Evie, and the CVE monsters in the Black Forest of 1865.
- Black Forest Commandos: Asgard Mission — the graphic novel behind the adventure in Asgard.
Meet the entire team and explore their missions.
A Swiss Break: Play Jass
Since we're in Basel, take a break with Swiss Jass: Commandos Edition, a Commandos-themed take on the Swiss card game.
- Play Jass in your browser.
- Get Swiss Jass: Commandos Edition on Google Play.
- Read the story behind the game.
SIP it before you ship it.
Invite Me to Speak
Available for conferences, workshops, corporate training, and meetups. I can present remotely or travel to your event.
