Dockerfile 2.32 KB
Newer Older
1
2
FROM debian:stretch

Matthew Pickering's avatar
Matthew Pickering committed
3
4
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

5
6
ENV LANG C.UTF-8

Matthew Pickering's avatar
Matthew Pickering committed
7
8
9
RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg dirmngr \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
10

11
12
13
# http://downloads.haskell.org/debian/
RUN echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com  --recv-keys BA3CBA3FFE22B574
14
15

# Core build utilities
Matthew Pickering's avatar
Matthew Pickering committed
16
RUN apt-get update -qq && apt-get install --no-install-recommends -qy \
17
    zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev libgmp-dev \
18
    ca-certificates g++ git make automake autoconf gcc \
Ben Gamari's avatar
Ben Gamari committed
19
    perl python3 texinfo xz-utils pxz lbzip2 bzip2 patch openssh-client sudo time \
Matthew Pickering's avatar
Matthew Pickering committed
20
    jq wget curl \
Ben Gamari's avatar
Ben Gamari committed
21
22
    # For source distributions
    xutils-dev \
Ben Gamari's avatar
Ben Gamari committed
23
24
    # DWARF libraries
    libdw1 libdw-dev \
25
26
    # For nofib
    valgrind \
Matthew Pickering's avatar
Matthew Pickering committed
27
    # Documentation tools
Ben Gamari's avatar
Ben Gamari committed
28
29
    texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-generic-extra \
    python3-pip \
Matthew Pickering's avatar
Matthew Pickering committed
30
31
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
Ben Gamari's avatar
Ben Gamari committed
32
RUN pip3 install sphinx==2.3.1
33

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
WORKDIR /tmp
# Install GHC and cabal
ENV GHC_VERSION 8.6.5
RUN curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb9-linux.tar.xz | tar -Jx;
WORKDIR /tmp/ghc-$GHC_VERSION
RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \
    make install;

WORKDIR /tmp
RUN rm -rf /tmp/ghc-$GHC_VERSION
ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH

# Get Cabal
ENV CABAL_VERSION 2.4.1.0
RUN curl https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \
    mv cabal /usr/local/bin/cabal
50
51

# LLVM
52
ENV LLVM_DIR /opt/llvm
Ben Gamari's avatar
Ben Gamari committed
53
ENV LLVM_VERSION 9.0.0
54
55
56
57
58
ENV PATH $LLVM_DIR/bin:$PATH
RUN curl http://releases.llvm.org/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz | tar -xJC .; \
    mkdir $LLVM_DIR && \
    cp -R clang+llvm*/* $LLVM_DIR && \
    rm -R clang+llvm* && \
59
60
61
62
63
64
    llc --version

# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
Ben Gamari's avatar
Ben Gamari committed
65
WORKDIR /home/ghc/
66
67

# Build Haskell tools
68
RUN cabal v2-update && \
Oleg Grenrus's avatar
Oleg Grenrus committed
69
    cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.19.10'
70
71
72
ENV PATH /home/ghc/.cabal/bin:$PATH

CMD ["bash"]