Distilling Java Containers for Kubernetes
summary
Java that used to over-allocate now respects container limits (use Java 8u191+ or later), and the demo actually shrinks a Spring Boot image from ~184 MB to ~84 MB on Alpine, to ~40 MB with JLink, and down to ~25 MB as a native image built into the container. The pipeline uses Docker multi-stage builds, JDeps analysis, and optional tools like dive and Docker Slim; ahead‑of‑time compilation via GraalVM yields much faster startup and lower memory, and the distilled binary runs correctly.
AI-written summary · about
chapters (12)
- 0:00Introduction to Java containers
- 6:22Distillation pattern explained
- 17:12Java in containers challenges
- 22:32JLink and JVM optimizations
- 27:52Native image with GraalVM
- 36:46Hands-on demo setup
- 41:18Building fat Java container
- 43:11Switching to Alpine base
- 47:27Multi-stage Docker builds
- 50:38JLink for smaller JRE
- 54:31Native image compilation
- 59:32Q&A and resources
related talks
20mSqueezing Java Containers: Shrinking Your Kubernetes Footprint with jlink
25mCommit to Excellence - Java in Containers
46mJava in a World of Containers
49mJava and Containers Make it Awesome
31mFast and Distroless Java in Containers: the Recipe!
42mDownsizing. Make Your Java App Containers Ligthweight.
46mJava in Container - Best Practicies for containerized Java Apps
55mDo not put all eggs in one container
