The nixos/nix image on dockerhub has 100 layers. Several of them just a few kilobytes in size.
In 2.3.16 it was 7 layers. Then something changed in the build process, and in the 2.5.1 it was already 67 layers. It has been 100 layers since at least 2.8.0.
As a smaller issue, this makes the layer download take much longer than needed since every layer is fetched individually. But the bigger problem is that in practice, there is a limit to the maximum amount of layers that AUFS will allow. It’s not clear what that limit is, since it may vary between versions and systems, that’s also why this is not documented. However, we found docker erroring out at 127 layers in our build pipeline, so the nixos/nix base image limits us to 27 layers.
If there is no technical reason to have so many layers, I would welcome a change to reduce this.
Relatedly: I was unable to find more information on where, how, and by whom the docker images on dockerhub are built, so I could submit this for discussion there. Perhaps I just missed it, pointers would be appreciated
The image is probalbly built from this expression:
It has a default maxLayers of 100, which matches your description.
You can build your own image from this with a lower layer max. Though the relevant output sadly doesn’t seem to be overrideable, so you have to import it manually when trying to build it.
Hey, thanks for your reply! That at least clears up where this image comes from
Wait, so it intentionally fills 100 layers? Or spreads the data over those layers? Or is it just using exactly 100 layers by coincidence and that is also specified as max?
I don’t quite get it, could you (or someone else) elaborate what’s going on there?