# vim: syntax=dockerfile

FROM debian:stretch-slim

LABEL maintainer="Nektar++ Development Team <nektar-users@imperial.ac.uk>"

WORKDIR /root

RUN DEBIAN_RELEASE=stretch && \
    echo "deb http://deb.debian.org/debian ${DEBIAN_RELEASE} non-free" > \
        /etc/apt/sources.list.d/debian-non-free.list && \
    apt-get update && \
    apt-get install -y \
        packaging-dev cmake git git-buildpackage vim \
        libboost-thread-dev libboost-iostreams-dev libboost-filesystem-dev \
            libboost-system-dev libboost-program-options-dev \
            libboost-python-dev libboost-regex-dev libboost-timer-dev \
        libarpack2-dev \
        libfftw3-dev \
        libhdf5-mpi-dev \
        liblapack-dev \
        libtinyxml-dev \
        mpi-default-dev \
        zlib1g-dev \
        python3-dev python3-numpy \
        libptscotch-dev \
        liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev libgl-dev \
            libtet1.5-dev libtriangle-dev \
        texlive-base texlive-latex-extra texlive-science \
            texlive-fonts-recommended texlive-pstricks \
        doxygen graphviz imagemagick dvipng

# Set Python3 to have higher priority than Python2.
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1 &&\
    update-alternatives --install /usr/bin/python python /usr/bin/python3 2

RUN groupadd nektar && useradd -m -g nektar nektar

# Force update to always run when building image
ARG INVALIDATE_CACHE
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y

USER nektar:nektar
WORKDIR /home/nektar
COPY docker/packaging/quiltrc .quiltrc
