From 3a58458c7d00c99c3bfcff6ec2e76296246c0c5e Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 12 Sep 2021 12:55:09 +0200 Subject: [PATCH] Add docker support --- docker/alpine/8.10.7/Dockerfile | 32 ++++++++++++++++++++++++++++++++ docker/alpine/minimal/Dockerfile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 docker/alpine/8.10.7/Dockerfile create mode 100644 docker/alpine/minimal/Dockerfile diff --git a/docker/alpine/8.10.7/Dockerfile b/docker/alpine/8.10.7/Dockerfile new file mode 100644 index 0000000..b8b3c42 --- /dev/null +++ b/docker/alpine/8.10.7/Dockerfile @@ -0,0 +1,32 @@ +FROM alpine:3.14.2 + +# install deps needed by GHC +RUN apk add --no-cache \ + curl \ + gcc \ + g++ \ + binutils \ + binutils-gold \ + gmp \ + ncurses \ + libffi \ + make \ + xz \ + tar \ + perl + +ARG GHCUP_VERSION + +# install ghcup +RUN if [ -n "$GHCUP_VERSION" ] ; \ + then curl -sSfL https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup ; \ + else curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup ; \ + fi && \ + chmod +x /usr/bin/ghcup + +ENV GHCUP_INSTALL_BASE_PREFIX=/usr/local +ENV PATH=/usr/local/.ghcup/bin:$PATH + +RUN ghcup install ghc --set 8.10.7 && \ + ghcup install cabal latest && \ + ghcup install stack latest diff --git a/docker/alpine/minimal/Dockerfile b/docker/alpine/minimal/Dockerfile new file mode 100644 index 0000000..63da709 --- /dev/null +++ b/docker/alpine/minimal/Dockerfile @@ -0,0 +1,30 @@ +FROM alpine:3.14.2 + +# install deps needed by GHC +RUN apk add --no-cache \ + curl \ + gcc \ + g++ \ + binutils \ + binutils-gold \ + gmp \ + ncurses \ + libffi \ + make \ + xz \ + tar \ + perl + +ARG GHCUP_VERSION + +# install ghcup +RUN if [ -n "$GHCUP_VERSION" ] ; \ + then curl -sSfL https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > /usr/bin/ghcup ; \ + else curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup ; \ + fi && \ + chmod +x /usr/bin/ghcup + +ENV GHCUP_INSTALL_BASE_PREFIX=/usr/local +ENV PATH=/usr/local/.ghcup/bin:$PATH + +RUN ghcup prefetch metadata