Skip to content

Commit 84922d1

Browse files
committed
Install GHC directly + bump to 8.10.5
Also sha256 verify GHC + stack and other minor clean up.
1 parent 3dbe069 commit 84922d1

File tree

3 files changed

+68
-19
lines changed

3 files changed

+68
-19
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
ghc: ['8.10.4', '9.0.1']
16+
ghc: ['8.10.5', '9.0.1']
1717
deb: ['stretch', 'buster']
1818
include:
19-
- ghc: '8.10.4'
19+
- ghc: '8.10.5'
2020
ghc_minor: '8.10'
2121
- ghc: '9.0.1'
2222
ghc_minor: '9.0'

8.10/buster/Dockerfile

+33-9
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,9 +23,10 @@ RUN apt-get update && \
1923
zlib1g-dev && \
2024
rm -rf /var/lib/apt/lists/*
2125

22-
ARG GHC=8.10.4
23-
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
26+
27+
# The cabal install process will also move away from the debian package once https://github.com/haskell/cabal/issues/7639 is resolved
2428
ARG CABAL_INSTALL=3.4
29+
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
2530

2631
RUN export GNUPGHOME="$(mktemp -d)" && \
2732
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${DEBIAN_KEY} && \
@@ -30,20 +35,39 @@ RUN export GNUPGHOME="$(mktemp -d)" && \
3035
echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \
3136
apt-get update && \
3237
apt-get install -y --no-install-recommends \
33-
cabal-install-${CABAL_INSTALL} \
34-
ghc-${GHC} && \
38+
cabal-install-${CABAL_INSTALL} && \
3539
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*
3640

41+
ARG GHC=8.10.5
42+
ARG GHC_RELEASE_KEY=88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4
43+
# get from https://downloads.haskell.org/~ghc/$GHC/SHA256SUMS
44+
ARG GHC_RELEASE_SHA256=BC623C20CA4C5C18E952071BA14AA0CFC5C94D34219BFFAA615F7B491F376787
45+
46+
RUN cd /tmp && \
47+
export GNUPGHOME="$(mktemp -d)" && \
48+
curl -sSLO https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-x86_64-deb10-linux.tar.xz && \
49+
curl -sSLO https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-x86_64-deb10-linux.tar.xz.sig && \
50+
gpg --batch --keyserver keyserver.ubuntu.com --receive-keys ${GHC_RELEASE_KEY} && \
51+
gpg --batch --trusted-key 588764FBE22D19C4 --verify ghc-$GHC-x86_64-deb10-linux.tar.xz.sig ghc-$GHC-x86_64-deb10-linux.tar.xz && \
52+
tar xf ghc-$GHC-x86_64-deb10-linux.tar.xz && \
53+
echo "$GHC_RELEASE_SHA256 ghc-$GHC-x86_64-deb10-linux.tar.xz" | sha256sum --strict --check && \
54+
cd ghc-$GHC && \
55+
./configure --prefix /opt/ghc/$GHC && \
56+
make install && \
57+
find /opt/ghc/$GHC/ \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete && \
58+
rm -rf "$GNUPGHOME" /tmp/*
59+
3760
ARG STACK=2.7.3
38-
ARG STACK_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
39-
ARG STACK_RELEASE_KEY=2C6A674E85EE3FB896AFC9B965101FF31C5C154D
61+
ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
62+
# get from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.sha256
63+
ARG STACK_RELEASE_SHA256=A6C090555FA1C64AA61C29AA4449765A51D79E870CF759CDE192937CD614E72B
4064

4165
RUN export GNUPGHOME="$(mktemp -d)" && \
42-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_KEY} && \
4366
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_RELEASE_KEY} && \
4467
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \
4568
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \
4669
gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \
70+
echo "$STACK_RELEASE_SHA256 stack.tar.gz" | sha256sum --strict --check && \
4771
tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \
4872
/usr/local/bin/stack config set system-ghc --global true && \
4973
/usr/local/bin/stack config set install-ghc --global false && \

8.10/stretch/Dockerfile

+33-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ FROM debian:stretch
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 \
910
dirmngr \
10-
g++ \
1111
git \
12+
gcc \
1213
gnupg \
14+
g++ \
15+
libc6-dev \
16+
libffi-dev \
17+
libgmp-dev \
1318
libsqlite3-dev \
1419
libtinfo-dev \
1520
make \
@@ -19,9 +24,10 @@ RUN apt-get update && \
1924
zlib1g-dev && \
2025
rm -rf /var/lib/apt/lists/*
2126

22-
ARG GHC=8.10.4
23-
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
27+
28+
# The cabal install process will also move away from the debian package once https://github.com/haskell/cabal/issues/7639 is resolved
2429
ARG CABAL_INSTALL=3.4
30+
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
2531

2632
RUN export GNUPGHOME="$(mktemp -d)" && \
2733
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${DEBIAN_KEY} && \
@@ -30,20 +36,39 @@ RUN export GNUPGHOME="$(mktemp -d)" && \
3036
echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list && \
3137
apt-get update && \
3238
apt-get install -y --no-install-recommends \
33-
cabal-install-${CABAL_INSTALL} \
34-
ghc-${GHC} && \
39+
cabal-install-${CABAL_INSTALL} && \
3540
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*
3641

42+
ARG GHC=8.10.5
43+
ARG GHC_RELEASE_KEY=88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4
44+
# get from https://downloads.haskell.org/~ghc/$GHC/SHA256SUMS
45+
ARG GHC_RELEASE_SHA256=15E71325C3BDFE3804BE0F84C2FC5C913D811322D19B0F4D4CFF20F29CDD804D
46+
47+
RUN cd /tmp && \
48+
export GNUPGHOME="$(mktemp -d)" && \
49+
curl -sSLO https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-x86_64-deb9-linux.tar.xz && \
50+
curl -sSLO https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-x86_64-deb9-linux.tar.xz.sig && \
51+
gpg --batch --keyserver keyserver.ubuntu.com --receive-keys ${GHC_RELEASE_KEY} && \
52+
gpg --batch --trusted-key 588764FBE22D19C4 --verify ghc-$GHC-x86_64-deb9-linux.tar.xz.sig ghc-$GHC-x86_64-deb9-linux.tar.xz && \
53+
tar xf ghc-$GHC-x86_64-deb9-linux.tar.xz && \
54+
echo "$GHC_RELEASE_SHA256 ghc-$GHC-x86_64-deb9-linux.tar.xz" | sha256sum --strict --check && \
55+
cd ghc-$GHC && \
56+
./configure --prefix /opt/ghc/$GHC && \
57+
make install && \
58+
find /opt/ghc/$GHC/ \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete && \
59+
rm -rf "$GNUPGHOME" /tmp/*
60+
3761
ARG STACK=2.7.3
38-
ARG STACK_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
39-
ARG STACK_RELEASE_KEY=2C6A674E85EE3FB896AFC9B965101FF31C5C154D
62+
ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
63+
# get from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.sha256
64+
ARG STACK_RELEASE_SHA256=A6C090555FA1C64AA61C29AA4449765A51D79E870CF759CDE192937CD614E72B
4065

4166
RUN export GNUPGHOME="$(mktemp -d)" && \
42-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_KEY} && \
4367
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_RELEASE_KEY} && \
4468
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \
4569
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \
4670
gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \
71+
echo "$STACK_RELEASE_SHA256 stack.tar.gz" | sha256sum --strict --check && \
4772
tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \
4873
/usr/local/bin/stack config set system-ghc --global true && \
4974
/usr/local/bin/stack config set install-ghc --global false && \

0 commit comments

Comments
 (0)