From 808abc7d35a65eb80445c5390c1c0870ac58fc8c Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Mon, 29 Aug 2022 17:15:40 +0100 Subject: [PATCH] Update arm64.Dockerfile Removes `stack setup ghc-8.10.4` and `stack update`, as neither should be required. Replaces `RUN cd /src` with `WORKDIR /src` as former does not appear to have the desired effect. Consistent with `release.hs`, use `--nightly-2022-08-02 --extra-dep Cabal-3.6.3.0` with final `stack script`. Also uses separate `RUN` commands rather than `&&`, for shorter lines and better clarity. --- etc/dockerfiles/arm64.Dockerfile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/etc/dockerfiles/arm64.Dockerfile b/etc/dockerfiles/arm64.Dockerfile index 5d36855ea2..75cdd54d16 100644 --- a/etc/dockerfiles/arm64.Dockerfile +++ b/etc/dockerfiles/arm64.Dockerfile @@ -16,18 +16,27 @@ RUN curl -sSL https://github.com/commercialhaskell/stack/releases/download/v2.7. ARG USERID ARG GROUPID -RUN useradd --uid $USERID stack && mkdir -p /home/stack && chown -R stack /home/stack && usermod -aG $GROUPID stack +RUN useradd --uid $USERID stack +RUN mkdir -p /home/stack +RUN chown -R stack /home/stack +RUN usermod -aG $GROUPID stack + USER stack WORKDIR /home/stack -RUN stack setup ghc-8.10.4 -RUN stack update - COPY stack.yaml package.yaml /src/ + USER root + RUN chown -R stack /src + USER stack -RUN cd /src && stack build --only-snapshot --test && stack build shake +WORKDIR /src + +RUN stack build --only-snapshot --test +RUN stack build shake COPY etc/scripts/release.hs /src -RUN stack script --resolver lts-17.15 --compile /src/release.hs -- --version && cp /src/release /home/stack + +RUN stack script --resolver nightly-2022-08-02 --extra-dep Cabal-3.6.3.0 --compile /src/release.hs -- --version +RUN cp /src/release /home/stack