Stop Writing Bad Dockerfiles: Multi-Stage Builds + Security Explained
Ramanuj Das
0:00 / 0:00
Stop Writing Bad Dockerfiles: Multi-Stage Builds + Security Explained
277 просмотров · 11 дней назад
Ramanuj Das
822 подписчика
277 просмотров · 11 дней назад
Most Dockerfiles work - but "working" isn't the same as "good," and it definitely isn't the same as "secure." In this video, I take a basic Dockerfile for a Java Spring Boot-style app and turn it into a production-ready, security-hardened, multi-stage build — step by step.
You'll learn:
✅ Why a basic Dockerfile forces your CI server (Jenkins, GitHub Actions, etc.) to have Maven and Java installed
✅ Why that setup breaks reproducibility and bloats your final image
✅ How multi-stage builds separate the "build" environment from the "runtime" environment
✅ Why the ORDER of instructions in your Dockerfile directly affects build speed and caching
✅ Security optimizations: running as non-root
✅ Regular JRE images vs distroless images - what you gain, what you trade off, and when to use each
✅ A before/after comparison of image size, attack surface, CI requirements, and rebuild speed
Whether you're deploying Java apps, setting up CI/CD pipelines, or just want your Docker images smaller, faster to build, and harder to break into, this one's for you.
🔧 Tools/Tech mentioned:
Docker, Java, Maven
Connect with me
📺 YouTube: / @ramanujds
📸 Instagram: / ramanuj_das_
💻 GitHub: https://github.com/ramanujds
💼 LinkedIn: / ramanujdas
🌐 Website: https://codewithramanuj.com