Interview Prep/Docker/Images, Layers & Storage Drivers

How do you reduce an image's size?

BeginnerConceptImages, Layers & Storage Drivers
Answer

Use a smaller base, multi-stage builds, combine RUN cleanup in the same layer, --no-install-recommends, a good .dockerignore, install only runtime dependencies, strip binaries, and avoid copying build tools. Verify with docker images, docker history and dive.

All Docker questions Roadmap: Docker & containers

More on Images, Layers & Storage Drivers