ci-images issueshttps://gitlab.haskell.org/ghc/ci-images/-/issues2024-03-06T15:37:48Zhttps://gitlab.haskell.org/ghc/ci-images/-/issues/5Images could be smaller2024-03-06T15:37:48ZBryan Rbryan@haskell.foundationImages could be smallerImages 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 runner...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`
1. Total image size is 5.7GB
2. When unpacking GHC, /opt/ghc/9.4.3/lib[/share/doc] adds 600MB that I don't think are ever used
3. `cabal update` is run twice, once as `root` and once as `ghc`. 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.