File tree 1 file changed +15
-14
lines changed
1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ FROM debian:buster AS builder
2
2
3
3
ENV LANG C.UTF-8
4
4
5
+ # install prerequisites
5
6
RUN apt-get update && \
6
7
apt-get install -y --no-install-recommends \
7
8
ca-certificates \
@@ -16,24 +17,24 @@ RUN apt-get update && \
16
17
curl && \
17
18
rm -rf /var/lib/apt/lists/*
18
19
20
+ # install ghcup
19
21
ARG GHCUP_VERSION=0.1.16.2
22
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup && \
23
+ chmod +x /usr/bin/ghcup
20
24
21
- RUN curl -fSL https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION -o ghcup && \
22
- chmod +x ghcup
23
-
25
+ # install cabal
24
26
ARG CABAL_VERSION=3.4.0.0
27
+ RUN ghcup install cabal -i /usr/bin $CABAL_VERSION
25
28
26
- RUN ./ghcup install cabal $CABAL_VERSION && \
27
- ./ghcup set cabal $CABAL_VERSION
28
-
29
- ARG GHC_VERSION=8.10.6
30
-
31
- RUN ./ghcup install ghc $GHC_VERSION && \
32
- ./ghcup set ghc $GHC_VERSION
33
-
29
+ # install stack
34
30
ARG STACK_VERSION=2.7.3
31
+ RUN ghcup install stack -i /usr/bin $STACK_VERSION
35
32
36
- RUN ./ghcup install stack $STACK_VERSION && \
37
- ./ghcup set stack $STACK_VERSION
33
+ # install GHC into /opt/ghc
34
+ ARG GHC_VERSION=8.10.6
35
+ RUN ghcup install ghc -i /opt/ghc $GHC_VERSION
38
36
39
- RUN cp -H /root/.ghcup/bin/* /usr/local/bin
37
+ # Adjust PATH
38
+ RUN echo 'export PATH="/opt/ghc/bin:$PATH"' >> /etc/profile.d/ghcup_path.sh && \
39
+ chmod +x /etc/profile.d/ghcup_path.sh
40
+ ENV PATH="/opt/ghc/bin:$PATH"
You can’t perform that action at this time.
0 commit comments