Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to ghcup as the installation method #44

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10.4', '9.0.1']
ghc: ['8.10.7', '9.0.1']
deb: ['stretch', 'buster']
include:
- ghc: '8.10.4'
- ghc: '8.10.7'
ghc_minor: '8.10'
- ghc: '9.0.1'
ghc_minor: '9.0'
Expand Down
89 changes: 56 additions & 33 deletions 8.10/buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
FROM debian:buster AS builder

ENV LANG C.UTF-8

# to install ghcup + ghc, cabal and stack
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
libffi-dev \
libffi6 \
libgmp-dev \
libgmp10 \
libncurses-dev \
libncurses5 \
libtinfo5 && \
rm -rf /var/lib/apt/lists/*

# install ghcup
ARG GHCUP_VERSION=0.1.16.2
RUN curl --proto '=https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup

# install cabal
ARG CABAL_VERSION=3.4.0.0
RUN ghcup install cabal -i /usr/local/bin $CABAL_VERSION

# install stack
ARG STACK_VERSION=2.7.3
RUN ghcup install stack -i /usr/local/bin $STACK_VERSION

# install GHC into /opt/ghc + remove profiling support
ARG GHC_VERSION=8.10.7
RUN ghcup install ghc -i /opt/ghc $GHC_VERSION && \
find /opt/ghc/lib -name "*.p_hi" -type f -delete && \
find /opt/ghc/lib -name "*_p.a" -type f -delete

FROM debian:buster

ENV LANG C.UTF-8

# common haskell + stack dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
dirmngr \
g++ \
git \
gnupg \
gcc \
g++ \
libc6-dev \
libffi-dev \
libgmp-dev \
libsqlite3-dev \
libtinfo-dev \
make \
Expand All @@ -19,36 +60,18 @@ RUN apt-get update && \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

ARG GHC=8.10.4
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
ARG CABAL_INSTALL=3.4
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /opt/ghc/bin /opt/ghc/bin
COPY --from=builder /opt/ghc/lib /opt/ghc/lib

RUN export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${DEBIAN_KEY} && \
gpg --batch --armor --export ${DEBIAN_KEY} > /etc/apt/trusted.gpg.d/haskell.org.gpg.asc && \
gpgconf --kill all && \
echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
cabal-install-${CABAL_INSTALL} \
ghc-${GHC} && \
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*

ARG STACK=2.7.3
ARG STACK_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
ARG STACK_RELEASE_KEY=2C6A674E85EE3FB896AFC9B965101FF31C5C154D

RUN export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_KEY} && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_RELEASE_KEY} && \
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \
gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \
tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \
/usr/local/bin/stack config set system-ghc --global true && \
/usr/local/bin/stack config set install-ghc --global false && \
rm -rf "$GNUPGHOME" /var/lib/apt/lists/* /stack.tar.gz.asc /stack.tar.gz

ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/${CABAL_INSTALL}/bin:/opt/ghc/${GHC}/bin:$PATH
# stack should use global ghc
RUN /usr/local/bin/stack config set system-ghc --global true && \
/usr/local/bin/stack config set install-ghc --global false

# ensure any user gets GHC on the path
RUN echo 'export PATH="/opt/ghc/bin:$PATH"' >> /etc/profile.d/ghc_path.sh && \
chmod +x /etc/profile.d/ghc_path.sh

ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/bin:$PATH

CMD ["ghci"]
89 changes: 56 additions & 33 deletions 8.10/stretch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
FROM debian:stretch AS builder

ENV LANG C.UTF-8

# to install ghcup + ghc, cabal and stack
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
libffi-dev \
libffi6 \
libgmp-dev \
libgmp10 \
libncurses-dev \
libncurses5 \
libtinfo5 && \
rm -rf /var/lib/apt/lists/*

# install ghcup
ARG GHCUP_VERSION=0.1.16.2
RUN curl --proto '=https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup

# install cabal
ARG CABAL_VERSION=3.4.0.0
RUN ghcup install cabal -i /usr/local/bin $CABAL_VERSION

# install stack
ARG STACK_VERSION=2.7.3
RUN ghcup install stack -i /usr/local/bin $STACK_VERSION

# install GHC into /opt/ghc + remove profiling support
ARG GHC_VERSION=8.10.7
RUN ghcup install ghc -i /opt/ghc $GHC_VERSION && \
find /opt/ghc/lib -name "*.p_hi" -type f -delete && \
AlistairB marked this conversation as resolved.
Show resolved Hide resolved
find /opt/ghc/lib -name "*_p.a" -type f -delete

FROM debian:stretch

ENV LANG C.UTF-8

# common haskell + stack dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
dirmngr \
g++ \
git \
gnupg \
gcc \
g++ \
libc6-dev \
libffi-dev \
libgmp-dev \
libsqlite3-dev \
libtinfo-dev \
make \
Expand All @@ -19,36 +60,18 @@ RUN apt-get update && \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

ARG GHC=8.10.4
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
ARG CABAL_INSTALL=3.4
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /opt/ghc/bin /opt/ghc/bin
COPY --from=builder /opt/ghc/lib /opt/ghc/lib

RUN export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${DEBIAN_KEY} && \
gpg --batch --armor --export ${DEBIAN_KEY} > /etc/apt/trusted.gpg.d/haskell.org.gpg.asc && \
gpgconf --kill all && \
echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
cabal-install-${CABAL_INSTALL} \
ghc-${GHC} && \
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*

ARG STACK=2.7.3
ARG STACK_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
ARG STACK_RELEASE_KEY=2C6A674E85EE3FB896AFC9B965101FF31C5C154D

RUN export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_KEY} && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_RELEASE_KEY} && \
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \
gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \
tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \
/usr/local/bin/stack config set system-ghc --global true && \
/usr/local/bin/stack config set install-ghc --global false && \
rm -rf "$GNUPGHOME" /var/lib/apt/lists/* /stack.tar.gz.asc /stack.tar.gz

ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/${CABAL_INSTALL}/bin:/opt/ghc/${GHC}/bin:$PATH
# stack should use global ghc
RUN /usr/local/bin/stack config set system-ghc --global true && \
/usr/local/bin/stack config set install-ghc --global false

# ensure any user gets GHC on the path
RUN echo 'export PATH="/opt/ghc/bin:$PATH"' >> /etc/profile.d/ghc_path.sh && \
chmod +x /etc/profile.d/ghc_path.sh

ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/bin:$PATH

CMD ["ghci"]
89 changes: 56 additions & 33 deletions 9.0/buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
FROM debian:buster AS builder

ENV LANG C.UTF-8

# to install ghcup + ghc, cabal and stack
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
libffi-dev \
libffi6 \
libgmp-dev \
libgmp10 \
libncurses-dev \
libncurses5 \
libtinfo5 && \
rm -rf /var/lib/apt/lists/*

# install ghcup
ARG GHCUP_VERSION=0.1.16.2
RUN curl --proto '=https' --tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup

# install cabal
ARG CABAL_VERSION=3.4.0.0
RUN ghcup install cabal -i /usr/local/bin $CABAL_VERSION

# install stack
ARG STACK_VERSION=2.7.3
RUN ghcup install stack -i /usr/local/bin $STACK_VERSION

# install GHC into /opt/ghc + remove profiling support
ARG GHC_VERSION=9.0.1
RUN ghcup install ghc -i /opt/ghc $GHC_VERSION && \
find /opt/ghc/lib -name "*.p_hi" -type f -delete && \
find /opt/ghc/lib -name "*_p.a" -type f -delete

FROM debian:buster

ENV LANG C.UTF-8

# common haskell + stack dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
dirmngr \
g++ \
git \
gnupg \
gcc \
g++ \
libc6-dev \
libffi-dev \
libgmp-dev \
libsqlite3-dev \
libtinfo-dev \
make \
Expand All @@ -19,36 +60,18 @@ RUN apt-get update && \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

ARG GHC=9.0.1
ARG DEBIAN_KEY=427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574
ARG CABAL_INSTALL=3.4
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /opt/ghc/bin /opt/ghc/bin
COPY --from=builder /opt/ghc/lib /opt/ghc/lib

RUN export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${DEBIAN_KEY} && \
gpg --batch --armor --export ${DEBIAN_KEY} > /etc/apt/trusted.gpg.d/haskell.org.gpg.asc && \
gpgconf --kill all && \
echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
cabal-install-${CABAL_INSTALL} \
ghc-${GHC} && \
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*

ARG STACK=2.7.3
ARG STACK_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442
ARG STACK_RELEASE_KEY=2C6A674E85EE3FB896AFC9B965101FF31C5C154D

RUN export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_KEY} && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ${STACK_RELEASE_KEY} && \
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \
curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \
gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \
tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \
/usr/local/bin/stack config set system-ghc --global true && \
/usr/local/bin/stack config set install-ghc --global false && \
rm -rf "$GNUPGHOME" /var/lib/apt/lists/* /stack.tar.gz.asc /stack.tar.gz

ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/${CABAL_INSTALL}/bin:/opt/ghc/${GHC}/bin:$PATH
# stack should use global ghc
RUN /usr/local/bin/stack config set system-ghc --global true && \
/usr/local/bin/stack config set install-ghc --global false

# ensure any user gets GHC on the path
RUN echo 'export PATH="/opt/ghc/bin:$PATH"' >> /etc/profile.d/ghc_path.sh && \
chmod +x /etc/profile.d/ghc_path.sh

ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/bin:$PATH

CMD ["ghci"]
Loading