Lesson 10 of 12 - Containers

Smaller, safer images

By Branko Petric - Updated - About 8 min - Full access

The short answer

Most image size comes from the base image and build tools you never use at runtime. Start from a slim or distroless base, use a multi-stage build so only the app and its runtime dependencies ship, run as a non-root user, and pin base image versions so builds do not change under you.

Want the bigger picture? This lesson maps to this step of the DevOps roadmap.