-
-
Save maxsu/098e896fb820b577b52214633861f5bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Build GHC in Alpine (for freshness) | |
FROM alpine:3.12 as hask | |
ENV ghc_version=8.6.5 | |
ENV deps="build-base dev perl tar xz \ | |
gmp-dev libffi-dev ncurses-dev zlib-dev" | |
ADD https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup ghcup | |
ADD https://get.haskellstack.org/stable/linux-x86_64.tar.gz stack | |
ADD https://api.github.com/alexwl/haskell-code-explorer/tarball hce | |
RUN apk add --no-cache $deps \ | |
# Setup stack and ghcup | |
&& tar xf stack */stack \ | |
&& chmod +x stack ghcup \ | |
&& ./ghcup set ghc $ghc_version \ | |
# Setup haskell code explorer | |
&& tar -xf hce \ | |
&& ./stack install hce \ | |
--system-ghc \ | |
--stack-yaml=stack-$ghc_version.yaml \ | |
--ghc-options='-optl-static -split-sections' | |
## Then trampoline onto Ubuntu (for luxury) | |
FROM ubuntu:focal as hask2 | |
ENV up=/root/.ghcup/bin | |
ENV PATH=$up:$PATH | |
ENV deps="build-essential pkg-config software-properties-common \ | |
libffi-dev libgmp-dev libncurses-dev libssl-dev \ | |
libtinfo5 libsodium-dev zlib1g-dev" | |
COPY --from=hask ghcup stack $up/*server $up/*indexer usr/bin/ | |
RUN apt-get update && apt-get install -y $deps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment