-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Simplified haskell devcontainer. #1705
base: main
Are you sure you want to change the base?
Simplified haskell devcontainer. #1705
Conversation
|
||
# [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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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.
ENV GHCUP_CURL_OPTS="-k" | ||
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE="1" | ||
ENV BOOTSTRAP_HASKELL_GHC_VERSION="$GHC_VERSION" | ||
ENV BOOTSTRAP_HASKELL_CABAL_VERSION="recommended" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, but in the previous version of the dockerfile those were defaulted to recommended
anyway.
Cross ref devcontainers/features#470 |
|
Proposing a new version of this dockerfile as the current one:
The dockerfile is a bit simplified following the official ghcup installation instructions + the installation script is supplemented with
GHCUP_CURL_OPTS
variable which handles problematic ssl certificates (better solutions to this welcome!).Thank you @hasufell for suggesting to use the bootstrap variables (e.g. ghc version).Linked issues I recently started:
I can confirm this works on an M1 MacBook pro and am hoping the community devcontainers for Haskell start supporting that platform soon.