This is the Git repository for the Docker Official Image for haskell.
For usage examples and image tags, see the Docker Hub page.
| Operating System | Support | Supported Versions | Support Variants |
|---|---|---|---|
| Debian | Yes | bookworm, bullseye (legacy buster directories still exist for older GHC lines) | standard, slim |
| Alpine | Planned | last 2 releases | N/A |
| Windows | Planned | ltsc2022 | windowsservercore, nanoserver |
- amd64
- arm64 (aarch64)
Stack and cabal-install are downloaded as upstream release archives and installed into /usr/local/bin.
GHC is installed from upstream bindists into /opt/ghc/<version>.
Each installation step verifies:
- the release signature (PGP)
- the archive checksum (
sha256)
The image PATH includes:
/root/.cabal/bin/root/.local/bin/opt/ghc/${GHC}/bin
Verification follows the Docker Official Images preferred process:
- verify the release signer via PGP key validation
- verify archive checksums
These images will support GHC minor versions (e.g., 9.2) that are either actively being maintained (new patch releases will come out) or are still popular. Once both of these are no longer true, support can be dropped. Users can still pull these images, however, they will not be listed on the docker hub page and will no longer be updated with new Cabal and Stack versions.
Only the latest patch release in each actively maintained minor line receives routine updates.
For actively supported GHC versions, Cabal and Stack should be updated when new versions are released.
Dockerfiles are generated from template/Dockerfile.jinja using YAML data files.
Build the generator (one-time or after generator changes):
cd generator
stack buildRegenerate a Dockerfile from the repository root with the helper script:
./generate.sh 9.14/bookworm.yaml 9.14/bookworm/DockerfileYou can also run the generator directly:
cd generator
stack run -- -t ../template/Dockerfile.jinja --data-file ../9.14/bookworm.yaml > ../9.14/bookworm/DockerfileGeneral layout:
<GHC line>/<variant>.yaml(for example9.14/bookworm.yaml) contains distro-specific values<GHC line>/_globals.yamlcontains shared values (for example Stack and cabal-install versions)- some lines also use shared fragments like
<GHC line>/_ghc.yamland<GHC line>/_cabal-install*.yaml <GHC line>/<variant>/Dockerfileis the generated output
The generator can print a few RuntimeError messages related to missing override keys; these are usually harmless.
docker build -t haskell-local 9.14/bookworm
docker run -it haskell-local bashThis is a two-step process:
- Update this repository (
haskell/docker-haskell). - Update the official-images library file to reference the new commit.
When GHC, cabal-install, or Stack releases a new version:
- Update versions, checksums, and release keys in the relevant YAML files.
- Regenerate affected Dockerfiles.
- Build and smoke-test locally.
- Open a PR and make sure CI passes.
- Bump the GHC version in relevant YAML files (for example
9.12.4->9.12.5). - Download checksums from
https://downloads.haskell.org/~ghc/<version>/SHA256SUMS. - Update the
x86_64andaarch64checksums for each affected distro/bindist. - If a bindist is missing for a target distro, add or update an override URL (see existing
overrides.ghc.aarch64.urlusage). - Update the release key if the releaser changed.
Known GHC releasers:
- Bump the cabal-install version in relevant
_globals.yamlfiles. - Download checksums from
https://downloads.haskell.org/~cabal/cabal-install-<version>/SHA256SUMS. - Update checksums for the expected bindists (for example
x86_64-linux-deb11,aarch64-linux-deb11,x86_64-linux-deb12,aarch64-linux-deb12, as needed by the affected lines). - Update the release key if the releaser changed.
Known cabal-install releasers:
- Bump the Stack version in relevant
_globals.yamlfiles. - Download checksums from the Stack release assets (for example
stack-<version>-linux-x86_64.tar.gz.sha256andstack-<version>-linux-aarch64.tar.gz.sha256). - Update both architecture checksums.
The Stack signing key is documented at https://docs.haskellstack.org/en/stable/SIGNING_KEY/ and is typically stable.
Images are built and released by Docker Official Images. The haskell entry is maintained in:
Typical release steps:
- Identify which GHC lines are affected.
- Update
GitCommitto the new commit in this repository. - Update
Tagswhen needed. - Open a PR in
docker-library/official-imageswith a clear summary. - After merge, Docker's build system publishes updated images.
More details: https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what
Docker Hub docs for this image live in:
This repository's CI (Validate Debian) builds images and runs the upstream official-images tests.
The CI matrix currently covers maintained Debian variants, with both amd64 and arm64 validation.
Dockerfiles are linted with hadolint via GitHub Actions.
Global exceptions are configured in .hadolint.yaml.
