Skip to content

Commit 1bfd047

Browse files
committed
Install GHC directly
1 parent d9bf04e commit 1bfd047

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

8.10/buster/Dockerfile

+33-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ FROM debian:buster
22

33
ENV LANG C.UTF-8
44

5+
# common haskell + stack dependencies
56
RUN apt-get update && \
67
apt-get install -y --no-install-recommends \
78
ca-certificates \
89
curl \
9-
dirmngr \
10-
g++ \
1110
git \
11+
gcc \
1212
gnupg \
13+
g++ \
14+
libc6-dev \
15+
libffi-dev \
16+
libgmp-dev \
1317
libsqlite3-dev \
1418
libtinfo-dev \
1519
make \
@@ -19,7 +23,10 @@ RUN apt-get update && \
1923
zlib1g-dev && \
2024
rm -rf /var/lib/apt/lists/*
2125

22-
ARG GHC=8.10.4
26+
# https://downloads.haskell.org/~cabal/cabal-install-3.6.0.0/ does not provide GPG signatures
27+
# except for the SHA256SUMS.sig . Not sure what the best process here is, probably ask
28+
# cabal to provide gpg signatures for the cabal-install tar files?
29+
2330
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
2431
ARG CABAL_INSTALL=3.4
2532

@@ -30,10 +37,31 @@ RUN export GNUPGHOME="$(mktemp -d)" && \
3037
echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \
3138
apt-get update && \
3239
apt-get install -y --no-install-recommends \
33-
cabal-install-${CABAL_INSTALL} \
34-
ghc-${GHC} && \
40+
cabal-install-${CABAL_INSTALL} && \
3541
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*
3642

43+
ARG GHC=8.10.7
44+
45+
# To be verified once https://gitlab.haskell.org/ghc/ghc/-/issues/20362 is resolved
46+
# gpg --batch --keyserver hkps://pgp.mit.edu:443 --receive-keys 588764FBE22D19C4 && \
47+
# gpg --batch --verify ghc-$GHC-x86_64-deb10-linux.tar.xz.sig ghc-$GHC-x86_64-deb10-linux.tar.xz && \
48+
49+
RUN cd /tmp && \
50+
export GNUPGHOME="$(mktemp -d)" && \
51+
curl -sSLO https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-x86_64-deb10-linux.tar.xz && \
52+
curl -sSLO https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-x86_64-deb10-linux.tar.xz.sig && \
53+
tar xf ghc-$GHC-x86_64-deb10-linux.tar.xz && \
54+
cd ghc-$GHC && \
55+
./configure --prefix /opt/ghc/$GHC && \
56+
make install && \
57+
find /opt/ghc/lib -name "*.p_hi" -type f -delete && \
58+
find /opt/ghc/lib -name "*_p.a" -type f -delete && \
59+
rm -rf "$GNUPGHOME" /tmp/*
60+
61+
# ensure any user gets GHC on the path
62+
RUN echo "export PATH=\"/opt/ghc/$GHC/bin:\$PATH\"" >> /etc/profile.d/ghc_path.sh && \
63+
chmod +x /etc/profile.d/ghc_path.sh
64+
3765
ARG STACK=2.7.3
3866
ARG STACK_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
3967
ARG STACK_RELEASE_KEY=2C6A674E85EE3FB896AFC9B965101FF31C5C154D

0 commit comments

Comments
 (0)