Images could be smaller
Images produced in this repo are large and could be smaller.
I looked into this when I noticed that downloading the CI image dominated runtime for Cabal jobs. A smaller image would make jobs faster and help with storage issues on runners.
I used dive to inspect the Docker image layers.
dive registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_15
- Total image size is 5.7GB
- When unpacking GHC, /opt/ghc/9.4.3/lib[/share/doc] adds 600MB that I don't think are ever used
-
cabal updateis run twice, once asrootand once asghc. Each run adds 1GB to the image. Presumably one of them could be avoided.
If we managed to drop 1.6 GB from this image, that would be a 28% savings.
I do wonder if it would be worthwhile to produce "slim" GHC bindists (or maybe just "official Docker images"?) that don't include docs. I imagine those 600 MB get passed around a lot in ephemeral CI jobs across the world.