Skip to content

Commit

Permalink
Dockerfiles: Consistently factor out GHCVER, CABALVER
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Jan 4, 2024
1 parent 88cc752 commit e72ca1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:22.04 AS build

ARG GHCVER="9.2.8"
ARG CABALVER="3.10.1.0"
RUN apt-get update && \
apt-get install -y \
# ghcup requirements
Expand All @@ -24,15 +26,15 @@ RUN z3 --version
ARG CRYPTOLPATH="/cryptol/.cryptol"
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
COPY cabal.GHC-9.2.8.config cabal.project.freeze
COPY cabal.GHC-${GHCVER}.config cabal.project.freeze
RUN mkdir -p /home/cryptol/.local/bin && \
curl -L https://downloads.haskell.org/~ghcup/0.1.19.4/x86_64-linux-ghcup-0.1.19.4 -o /home/cryptol/.local/bin/ghcup && \
chmod +x /home/cryptol/.local/bin/ghcup
RUN mkdir -p /home/cryptol/.ghcup && \
ghcup --version && \
ghcup install cabal 3.10.1.0 && \
ghcup install ghc 9.2.8 && \
ghcup set ghc 9.2.8
ghcup install cabal ${CABALVER} && \
ghcup install ghc ${GHCVER} && \
ghcup set ghc ${GHCVER}
RUN cabal v2-update && \
cabal v2-build -j cryptol:exe:cryptol && \
cp $(cabal v2-exec which cryptol) rootfs/usr/local/bin && \
Expand Down
3 changes: 2 additions & 1 deletion cryptol-remote-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG GHCVER="9.2.8"
ARG CABALVER="3.10.1.0"
ARG GHCVER_BOOTSTRAP="8.10.2"
FROM ubuntu:22.04 AS toolchain
ARG PORTABILITY=false
Expand All @@ -18,7 +19,7 @@ ENV GHCUP_INSTALL_BASE_PREFIX=/opt \
PATH=/opt/.ghcup/bin:/root/.local/bin:$PATH
RUN curl -o /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/0.1.19.4/x86_64-linux-ghcup-0.1.19.4" && \
chmod +x /usr/local/bin/ghcup
RUN ghcup install cabal 3.10.1.0 --set
RUN ghcup install cabal ${CABALVER} --set
ENV PATH=/root/.cabal/bin:$PATH
ADD ./cryptol-remote-api/ghc-portability.patch .
ARG GHCVER
Expand Down

0 comments on commit e72ca1f

Please sign in to comment.