Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Simplified haskell devcontainer. #1705

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions containers/haskell/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set BOOTSTRAP_HASKELL_GHC_VERSION to install a specific GHC version.

You probably also want BOOTSTRAP_HASKELL_NONINTERACTIVE=1.

For a full list of env vars affecting the bootstrap, see https://github.com/haskell/ghcup-hs/blob/master/scripts/bootstrap/bootstrap-haskell#L7

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, fantastic, thank you. Exactly what I wanted. Updating my PR now.


# 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"