What Is a Squashed Image?
A squashed image is a container image in which the individual build layers have been merged into a single layer. Squashing removes intermediate files and secrets that earlier layers may have left behind, and can shrink the on-disk image. The trade-off is that the merged layer no longer shares cache with other images.
Why it matters
Squashing helps when an earlier layer wrote a file that a later layer deleted, since the deleted bytes still occupy the original layer until squashed. But collapsing everything into one layer means every pull re-downloads the whole thing, defeating layer reuse. Multi-stage builds usually achieve the same cleanliness without losing sharing.
Related guides
What Is an Image Layer?An image layer is one filesystem diff in a container image; layers stack to form the final filesystem and are…
What Is a Build Secret Mount?A build secret mount exposes a credential to a single build step at runtime without baking it into any image…
What Is a BuildKit Frontend?A BuildKit frontend translates a build definition such as a Dockerfile into the low-level build graph that Bu…