Dockerfile 1.05 KB
Newer Older
1 2 3 4 5 6
FROM debian:stretch

ENV LANG C.UTF-8

RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > /etc/apt/sources.list.d/ghc.list

Ben Gamari's avatar
Ben Gamari committed
7
RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg sudo git python3 dirmngr ca-certificates \
Matthew Pickering's avatar
Matthew Pickering committed
8 9 10 11 12 13
    && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 \
    && apt-get update \
    && apt-get install --no-install-recommends -qy cabal-install-2.2 ghc-8.4.2 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

Matthew Pickering's avatar
Matthew Pickering committed
14
ENV PATH /opt/local/bin:/home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
15

Matthew Pickering's avatar
Matthew Pickering committed
16 17
RUN mkdir -p /opt/local/bin

18 19 20 21 22
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc

Matthew Pickering's avatar
Matthew Pickering committed
23
WORKDIR /home/ghc/
24 25 26
# Build Linting tools
RUN cabal update

27
RUN git clone https://gitlab.haskell.org/ghc/git-haskell-org-hooks
Matthew Pickering's avatar
Matthew Pickering committed
28 29 30
WORKDIR /home/ghc/git-haskell-org-hooks
RUN cabal install

31

Matthew Pickering's avatar
Matthew Pickering committed
32 33 34 35 36 37
USER root
RUN mv /home/ghc/.cabal/bin/* /opt/local/bin/
RUN rm -rf /home/ghc/*

USER ghc
WORKDIR /home/ghc
38 39

CMD ["bash"]