Skip to content
Latchkey

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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →