From 93863bf5d8bf80da6b63b257bcd2b2da9f5cd6ab Mon Sep 17 00:00:00 2001 From: Alistair Burrowes Date: Sun, 22 Aug 2021 11:29:34 +1000 Subject: [PATCH 1/2] Playing with ghcup as an install method --- 8.10/ghcup/Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 8.10/ghcup/Dockerfile diff --git a/8.10/ghcup/Dockerfile b/8.10/ghcup/Dockerfile new file mode 100644 index 0000000..01a5edd --- /dev/null +++ b/8.10/ghcup/Dockerfile @@ -0,0 +1,39 @@ +FROM debian:buster AS builder + +ENV LANG C.UTF-8 + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + build-essential \ + libffi-dev \ + libffi6 \ + libgmp-dev \ + libgmp10 \ + libncurses-dev \ + libncurses5 \ + libtinfo5 \ + curl && \ + rm -rf /var/lib/apt/lists/* + +ARG GHCUP_VERSION=0.1.16.2 + +RUN curl -fSL https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION -o ghcup && \ + chmod +x ghcup + +ARG CABAL_VERSION=3.4.0.0 + +RUN ./ghcup install cabal $CABAL_VERSION && \ + ./ghcup set cabal $CABAL_VERSION + +ARG GHC_VERSION=8.10.6 + +RUN ./ghcup install ghc $GHC_VERSION && \ + ./ghcup set ghc $GHC_VERSION + +ARG STACK_VERSION=2.7.3 + +RUN ./ghcup install stack $STACK_VERSION && \ + ./ghcup set stack $STACK_VERSION + +RUN cp -H /root/.ghcup/bin/* /usr/local/bin \ No newline at end of file From 1cb1ec15fc2edf2bea1e378d6fc30efe86494bb3 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 22 Aug 2021 09:09:01 +0200 Subject: [PATCH 2/2] Adjust with --isolate --- 8.10/ghcup/Dockerfile | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/8.10/ghcup/Dockerfile b/8.10/ghcup/Dockerfile index 01a5edd..38b2902 100644 --- a/8.10/ghcup/Dockerfile +++ b/8.10/ghcup/Dockerfile @@ -2,6 +2,7 @@ FROM debian:buster AS builder ENV LANG C.UTF-8 +# install prerequisites RUN apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates \ @@ -16,24 +17,24 @@ RUN apt-get update && \ curl && \ rm -rf /var/lib/apt/lists/* +# install ghcup ARG GHCUP_VERSION=0.1.16.2 +RUN curl --proto '=https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup && \ + chmod +x /usr/bin/ghcup -RUN curl -fSL https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION -o ghcup && \ - chmod +x ghcup - +# install cabal ARG CABAL_VERSION=3.4.0.0 +RUN ghcup install cabal -i /usr/bin $CABAL_VERSION -RUN ./ghcup install cabal $CABAL_VERSION && \ - ./ghcup set cabal $CABAL_VERSION - -ARG GHC_VERSION=8.10.6 - -RUN ./ghcup install ghc $GHC_VERSION && \ - ./ghcup set ghc $GHC_VERSION - +# install stack ARG STACK_VERSION=2.7.3 +RUN ghcup install stack -i /usr/bin $STACK_VERSION -RUN ./ghcup install stack $STACK_VERSION && \ - ./ghcup set stack $STACK_VERSION +# install GHC into /opt/ghc +ARG GHC_VERSION=8.10.6 +RUN ghcup install ghc -i /opt/ghc $GHC_VERSION -RUN cp -H /root/.ghcup/bin/* /usr/local/bin \ No newline at end of file +# Adjust PATH +RUN echo 'export PATH="/opt/ghc/bin:$PATH"' >> /etc/profile.d/ghcup_path.sh && \ + chmod +x /etc/profile.d/ghcup_path.sh +ENV PATH="/opt/ghc/bin:$PATH"