-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path.gitpod.Dockerfile
36 lines (29 loc) · 1.47 KB
/
.gitpod.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM gitpod/workspace-base
# Use ghc version 9.2.5
ENV GHC_VERSION=9.2.5
# Env variables:
# - Adds ghcup binary folde to path
# - set ghcup instalation script to non-interactive
# - set ghcup instalation script to minimal instalation. That is: just install ghcup and nothing else
ENV PATH=${PATH}:${HOME}/.ghcup/bin
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=true
ENV BOOTSTRAP_HASKELL_MINIMAL=true
# Install dependencies
RUN sudo apt-get install -y build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
# ghcup is a replacement for the haskell platform. It manages the development env easily.
# We use the official instalation script
RUN sudo curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
# Set up the environment.
RUN ghcup install ghc ${GHC_VERSION} --set
RUN ghcup install hls
RUN ghcup install stack
RUN ghcup install cabal
# change stack configuration to use system installed ghc.
# By default, stack tool will download its own version of the compiler,
# Setting up this configuration will avoid downloading haskell compiler twice.
RUN stack config set install-ghc --global false
RUN stack config set system-ghc --global true
# Finally, set the yaml file to the desired GHC_VERSION. This should be done
# after stack config set ..., otherwise stack fails because it interprets that stack-ghc-xxx.yaml
# should be the global configuration file, instead of project specific.
ENV STACK_YAML=stack-ghc-${GHC_VERSION}.yaml