Dockerfile 2 KB
Newer Older
1
2
FROM centos:7

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

5
6
7
8
ENV LANG C.UTF-8

# Core build utilities
RUN yum -y install coreutils binutils which git make \
Ben Gamari's avatar
Ben Gamari committed
9
    automake autoconf gcc perl python3 texinfo xz pxz lbzip2 bzip2 \
10
11
12
13
14
15
16
17
18
19
20
21
22
    patch openssh-clients sudo zlib-devel sqlite \
    ncurses-compat-libs gmp-devel ncurses-devel gcc-c++ findutils \
    curl wget jq

# Documentation tools
RUN yum -y install python-sphinx \
    texlive texlive-latex texlive-xetex \
    texlive-collection-latex texlive-collection-latexrecommended \
    texlive-xetex-def texlive-collection-xetex \
    python-sphinx-latex dejavu-sans-fonts dejavu-serif-fonts \
    dejavu-sans-mono-fonts

# This is in the PATH when I ssh into the CircleCI machine but somehow
Matthew Pickering's avatar
Matthew Pickering committed
23
# sphinx-build isn't found during configure unless we explicitly
24
25
26
27
28
29
30
31
32
# add it here as well; perhaps PATH is being overridden by CircleCI's
# infrastructure?
ENV PATH /usr/libexec/python3-sphinx:$PATH

# systemd isn't running so remove it from nsswitch.conf
# Failing to do this will result in testsuite failures due to
# non-functional user lookup (#15230).
RUN sed -i -e 's/systemd//g' /etc/nsswitch.conf

Matthew Pickering's avatar
Matthew Pickering committed
33
WORKDIR /tmp
34
# Install GHC and cabal
35
ENV GHC_VERSION 8.6.5
Ben Gamari's avatar
Ben Gamari committed
36
RUN curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-centos7-linux.tar.xz | tar -Jx
37
38
WORKDIR /tmp/ghc-$GHC_VERSION
RUN ./configure --prefix=/opt/ghc/$GHC_VERSION && make install
Matthew Pickering's avatar
Matthew Pickering committed
39
40

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

Matthew Pickering's avatar
Matthew Pickering committed
44
WORKDIR /tmp
45
# Get Cabal
46
47
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 && \
48
    mv cabal /usr/local/bin/cabal
49
50
51
52
53
54
55

# Create a normal user.
RUN adduser ghc --comment "GHC builds"
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
WORKDIR /home/ghc/

56
57
# Build Haskell tools
RUN cabal v2-update && \
Oleg Grenrus's avatar
Oleg Grenrus committed
58
    cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.19.10'
59
60
61
ENV PATH /home/ghc/.cabal/bin:$PATH

CMD ["bash"]