A build system transforms source code and dependencies into deployable artifacts. In container builds, it also determines whether compilers, package caches, and other build-time files remain inside production images. section 8.2.1
Use the build workflow to control image size:
- Inspect layer sizes with docker history, or an equivalent container tool. section 8.2.1
- Browse layer contents with Dive to locate files, caches, and unnecessary build artifacts. section 8.2.1
Removing build weight
A checkout API carried a 1.3GB installation layer because one command installed system packages, compiled native Python extensions, and retained build tools and caches. A builder stage can perform that work while a slim production stage receives only the installed runtime files. section 8.2.1




