How to make smaller Docker containers (including multi-stage build demo!)

Опубликовано: 16 Январь 2025
на канале: DevOps Directive
10,830
417

If not careful, containers can become much larger than necessary which makes them annoying to download/upload from/to a container registry.

However, with a few simple tips, it is possible to build lightweight, snappy images. In this video, I share two techniques that can help make your production images smaller!

I hope you find these helpful to make your containerized applications a bit lighter.

Cheers!

---
Join the Community:
💬 Discord:   / discord  
💻 GitHub: https://github.com/sidpalas/devops-di...
🐥 Twitter:   / sidpalas  
👨‍💼 LinkedIn:   / sid-palas  
🌐 Website: https://devopsdirective.com

---

Timestamps:
0:00 - Intro
0:34 - Example webserver code
0:55 - Example naive Dockerfiles
1:30 - Examining image sizes
1:47 - Tip #1 (use smaller base images)
2:24 - Confirming the smaller image sizes
2:59 - Tip #2 (use multi-stage Docker builds)
4:00 - Closing thoughts

---

Community Size at Time of Posting:
Subscribers: 332
Channel Views: 5196

Note: I have a running joke with my wife that I'm not going to shave my beard until I reach 1000 subscribers (the last time I did was at 100...) and it is starting to get out of control 🧔+🎅