This repository provides base Docker images for building Haskell projects using Stack.
lts-18.28
(ghc-8.10.8
)lts-18.8
(ghc-8.10.6
)lts-18.6
(ghc-8.10.4
)
Building non-trivial Haskell projects usually takes quite some time. This can be
annoying if the development cycle requires frequent Docker builds and
deployments. There are some best practices published to shorten build times.
But they usually suffer from improper build caching, especially when the
stack.yaml
or .cabal
files change between builds.
Images under this repository stick on to specific Stack resolvers, builds and installs widely used (at least in our shop) Haskell packages in the given resolver. These images can then be used as base images to compile Haskell Stack projects.
Our images are verrry big. You may wish to run away to adopt another solution if this is a problem for you.
Build process attempts to install a significant number of Haskell packages. Not all packages may be in a certain resolver. We may wish to gracefully attempt to install a Haskell package, but continue if it does not exist in the specific resolver.
Our images are built on top of stock Ubuntu 20.04 Docker image. You may experience linking issues if your build image (or runtime) is different than Ubuntu 20.04.
To build a Docker image with default build arguments:
docker build -t my-docker-haskell-stack .
To build a Docker image with an alternative resolver:
docker build -t my-docker-haskell-stack --build-arg RESOLVER="lts-18.1" .
First try to build the image to ensure that everything (!) is OK:
./build.sh -r telostat -d docker-haskell-stack -v testing
Finally, update versions in this README.md
file (see Latest Tags
at the top of the file) and trigger the release process:
./release.sh -r telostat -d docker-haskell-stack -v <VERSION>
Release process performs git commits and taging, and then, it builds Docker images, retags and pushes them to the Docker registry.