1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-12 14:28:08 +03:00
juvix/docker
janmasrovira 2db738a76f
Upgrade stack snapshot to use ghc-9.2.5 (#1621)
* upgrade stack snapshot to use ghc-9.2.5

* use lts-20.2

* Update alpine GHC Dockerfile to 9.2.5

We also build the Juvix runtime before the stack build in the
linux-static-binary workflow file.

* Add some documentation on how to build and deploy the alpine GHC image

* Docker documentation clarification.

Co-authored-by: Paul Cadman <git@paulcadman.dev>
2022-12-02 10:04:56 +01: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
README.md Upgrade stack snapshot to use ghc-9.2.5 (#1621) 2022-12-02 10:04:56 +01: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.5 -f Dockerfile-ghc-alpine-9.2.5 .

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.5

Pushing the image

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