Dockerfile 1.69 KB
Newer Older
1
FROM i386/debian:stretch
2

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

5
6
7
ENV LANG C.UTF-8

# Core build utilities
Matthew Pickering's avatar
Matthew Pickering committed
8
9
10
RUN apt-get update -qq \
    && apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev \
    libsqlite3-0 libsqlite3-dev \
11
    ca-certificates g++ git make automake autoconf gcc \
Ben Gamari's avatar
Ben Gamari committed
12
    perl python3 texinfo xz-utils pxz lbzip2 bzip2 patch openssh-client sudo time \
Matthew Pickering's avatar
Matthew Pickering committed
13
14
    jq wget curl \
    # Documentation tools
Ben Gamari's avatar
Ben Gamari committed
15
    python3-pip texlive-xetex texlive-latex-extra texlive-generic-extra texlive-fonts-recommended lmodern \
Matthew Pickering's avatar
Matthew Pickering committed
16
17
18
19
    # Core build utilities
    libgmp-dev:i386 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
Ben Gamari's avatar
Ben Gamari committed
20
RUN pip3 install sphinx==2.3.1
Matthew Pickering's avatar
Matthew Pickering committed
21
22

WORKDIR /tmp
23
# Get i386 GHC bindist for 32 bit CI builds.
24
ENV GHC_VERSION 8.6.5
Ben Gamari's avatar
Ben Gamari committed
25
RUN curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-i386-deb9-linux.tar.xz | tar -Jx;
26
27
WORKDIR /tmp/ghc-$GHC_VERSION
RUN setarch i386 ./configure --prefix=/opt/ghc-i386/$GHC_VERSION CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \
Matthew Pickering's avatar
Matthew Pickering committed
28
    make install; \
29
30
    rm -rf /tmp/ghc-$GHC_VERSION
ENV PATH /opt/ghc-i386/$GHC_VERSION/bin:$PATH
31

Matthew Pickering's avatar
Matthew Pickering committed
32
WORKDIR /tmp
33
# Get Cabal
34
35
ENV CABAL_VERSION 2.4.1.0
RUN curl https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-i386-unknown-linux.tar.xz | tar -Jx && \
36
37
38
39
40
41
    mv cabal /usr/local/bin/cabal

# 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
42
WORKDIR /home/ghc/
43
44

# Build Haskell tools
45
RUN cabal v2-update && \
Oleg Grenrus's avatar
Oleg Grenrus committed
46
    cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.19.10'
47
48
49
ENV PATH /home/ghc/.cabal/bin:$PATH

CMD ["bash"]