Dockerfile 1.23 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
    && 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 \
Ben Gamari's avatar
Ben Gamari committed
11
    && apt-get install --no-install-recommends -qy python3-pip \
Matthew Pickering's avatar
Matthew Pickering committed
12 13 14
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

Ben Gamari's avatar
Ben Gamari committed
15 16
RUN pip3 install mypy==0.701

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

Matthew Pickering's avatar
Matthew Pickering committed
19 20
RUN mkdir -p /opt/local/bin

21 22 23 24 25
# 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
26
WORKDIR /home/ghc/
27

28 29
# Build Linting tools
RUN cabal update
30 31
RUN git clone https://gitlab.haskell.org/ghc/git-haskell-org-hooks && \
    git -C git-haskell-org-hooks checkout 0df6168bdc1c52f9ebfd98a7b424e716f131330d
Matthew Pickering's avatar
Matthew Pickering committed
32 33 34
WORKDIR /home/ghc/git-haskell-org-hooks
RUN cabal install

35

Matthew Pickering's avatar
Matthew Pickering committed
36 37 38 39 40 41
USER root
RUN mv /home/ghc/.cabal/bin/* /opt/local/bin/
RUN rm -rf /home/ghc/*

USER ghc
WORKDIR /home/ghc
42 43

CMD ["bash"]