1
1
mirror of https://github.com/anoma/juvix.git synced 2024-10-27 02:04:29 +03:00
juvix/docker
Jonathan Cubides d78a543c57
Bump to LTS Haskell 20.21 (ghc-9.2.7) (#2093)
This PR upgrades our Haskell configurations to compile with version
9.2.7. The checklist below can serve as a guide for similar future
updates:

- [x] Update Stack resolver in `stack.yaml`
- [x] Modify `tested-with` section in `package.yaml`
- [x] Build and push the new compiler docker image, see instructions
here
[docker/README.md](https://github.com/anoma/juvix/blob/main/docker/README.md):
`ghcr.io/paulcadman/ghc-alpine:9.2.7 container`.
- [x] Update Linux Github Action workflow in
`.github/workflows/linux-static-binary.yaml` and adjust
`docker/Dockerfile-ghc-alpine-9.2.7`
- [x] Revise GHC/Stack/Cabal versions in `.devcontainer/Dockerfile`
- [x] Refresh Cabal configuration in `cabal-project`
2023-05-15 12:06:18 +02:00
..
Dockerfile-ghc-alpine-9.2.5 Upgrade stack snapshot to use ghc-9.2.5 (#1621) 2022-12-02 10:04:56 +01:00
Dockerfile-ghc-alpine-9.2.7 Bump to LTS Haskell 20.21 (ghc-9.2.7) (#2093) 2023-05-15 12:06:18 +02:00
README.md Bump to LTS Haskell 20.21 (ghc-9.2.7) (#2093) 2023-05-15 12:06:18 +02:00

The GHC alpine image

We need this image to workaround an issue with the official GHC alpine binary, see https://gitlab.haskell.org/ghc/ghc/-/issues/20266

We use this image to make static linux binaries.

Building the image

The tag of the image should be prefixed by the location of the GitHub docker repository that you're pushing to. In this case the repository is ghcr.io/paulcadman.

docker build -t ghcr.io/paulcadman/ghc-alpine:9.2.7 -f Dockerfile-ghc-alpine-9.2.7 .

Authenticating with the GitHub Docker repository

First create a classic personal access token with repo and write:packages permissions.

Consult the GitHub documentation on how to do this:

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry

Set the token to the variable CR_PAT and then authenticate:

echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin

NB: You do not substitue your username for USERNAME in the command above.

Testing the image

docker run -it --rm ghcr.io/paulcadman/ghc-alpine:9.2.7

Pushing the image

docker push ghcr.io/paulcadman/ghc-alpine:9.2.7