From b9729dfc651a08059f41c6c9f19e0c1ca390db8b Mon Sep 17 00:00:00 2001 From: Piotr Justyna Date: Mon, 19 Dec 2022 20:53:24 +0000 Subject: [PATCH 1/2] Simplified haskell devcontainer. --- containers/haskell/.devcontainer/Dockerfile | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/containers/haskell/.devcontainer/Dockerfile b/containers/haskell/.devcontainer/Dockerfile index c8f317e6d1..79485d6221 100644 --- a/containers/haskell/.devcontainer/Dockerfile +++ b/containers/haskell/.devcontainer/Dockerfile @@ -31,19 +31,6 @@ RUN apt-get update \ # Install latest GHCup in the non-root user home USER $USERNAME -RUN mkdir -p "$HOME/.ghcup/bin" \ - && curl -LJ "https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup" -o "$HOME/.ghcup/bin/ghcup" \ - && chmod +x "$HOME/.ghcup/bin/ghcup" -ENV PATH="/home/$USERNAME/.cabal/bin:/home/$USERNAME/.ghcup/bin:$PATH" - -# [Choice] GHC version: recommended, latest, 9.2, 9.0, 8.10, 8.8, 8.6 -ARG GHC_VERSION="${templateOption:ghcVersion}" +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | GHCUP_CURL_OPTS="-k" sh -# Use GHCup to install versions of main utilities -# If you prefer to let the Haskell extension install everything on demand, -# comment out the lines below. In that case, you may need to manually run "cabal update""." -RUN ghcup install ghc "${GHC_VERSION}" --set \ - && ghcup install cabal recommended --set \ - && ghcup install stack recommended --set \ - && ghcup install hls recommended --set \ - && cabal update +ENV PATH="/home/$USERNAME/.cabal/bin:/home/$USERNAME/.ghcup/bin:$PATH" From dd89fe8d057a2d5847339213bf597eacef67aeaf Mon Sep 17 00:00:00 2001 From: Piotr Justyna Date: Tue, 20 Dec 2022 10:20:01 +0000 Subject: [PATCH 2/2] Update Dockerfile Added some bootstrap variables: * non interactive installation * ghc version dictated by the devcontainer template * cabal version defined explicitly Unfortunately, no option to define cabal and hls versions explicitly. --- containers/haskell/.devcontainer/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/containers/haskell/.devcontainer/Dockerfile b/containers/haskell/.devcontainer/Dockerfile index 79485d6221..16e56704be 100644 --- a/containers/haskell/.devcontainer/Dockerfile +++ b/containers/haskell/.devcontainer/Dockerfile @@ -31,6 +31,13 @@ RUN apt-get update \ # Install latest GHCup in the non-root user home USER $USERNAME -RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | GHCUP_CURL_OPTS="-k" sh +ARG GHC_VERSION="${templateOption:ghcVersion}" + +ENV GHCUP_CURL_OPTS="-k" +ENV BOOTSTRAP_HASKELL_NONINTERACTIVE="1" +ENV BOOTSTRAP_HASKELL_GHC_VERSION="$GHC_VERSION" +ENV BOOTSTRAP_HASKELL_CABAL_VERSION="recommended" + +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh ENV PATH="/home/$USERNAME/.cabal/bin:/home/$USERNAME/.ghcup/bin:$PATH"