commercialhaskell / stackage

Stable Haskell package sets: vetted consistent packages from Hackage
https://www.stackage.org/
MIT License
527 stars 805 forks source link

Corralling the proliferation of container images #7397

Open chreekat opened 5 months ago

chreekat commented 5 months ago

I've got a question about container images.

automated/build.sh runs most of its actions in an image ghcr.io/commercialhaskell/stackage/build . This image is built in a GitHub Action on the stackage repo. Its source is Dockerfile at the root of the stackage repo.

Separately, an image https://hub.docker.com/r/fpco/stack-build is built from within automated/build.sh itself. It's built from automated/dockerfiles/lts-*/Dockerfile .

Both images are tagged for particular LTSs, and both include all the system packages needed for building all of Stackage. The Dockerfiles RUN the same underlying scripts docker/*.sh .

I guess my first question is why are there two separate processes for creating similar-but-different images?

Second question - perhaps automated/dockerfiles/lts-22.7/Dockerfile should be setting the same STACK_VERSION as Dockerfile?

Third question: should we deprecate the Dockerhub images?

sorry for the issue title

alaendle commented 5 months ago

Thanks for raising this issue @chreekat - it's always good when someone new looks at things - as @juhp already expressed on slack - we got used to these images 😄 .

To add my opinion: Long time ago I also relied on the fpco images (https://github.com/commercialhaskell/stackage/issues/5868) - so this was already an issue back in 2021. Also non of the images we provide is actual a good base for end-users to create their own haskell application images (also nowadays it is super easy to create a own tailored image by tools like ghcup). If the image is only used for some stackage related testing, the ghcr-image should be used - since this image at the end will get used during the builds. From my experience the published images make a promise that couldn't be kept (e.g. https://github.com/commercialhaskell/stackage/issues/6959 - and just take a look at docker hub how long this images is "only" a few 100 MB's in size and not the full 3-4 GB) - so I believe it's okay to deprecate.

chreekat commented 5 months ago

Ok, let's deprecate https://hub.docker.com/r/fpco/stack-build and https://hub.docker.com/r/fpco/stack-build-small

Edit: I originally wrote "find any docs mentioning the deprecated images and point them to https://github.com/commercialhaskell/stackage/pkgs/container/stackage%2Fbuild instead." But is that right?

chreekat commented 5 months ago

I don't consider this high-priority so I won't be doing it myself any time soon :upside_down_face: