FROM ubuntu:xenial

ENV https_proxy http://proxy.ill.fr:8888
ENV http_proxy http://proxy.ill.fr:8888

# Install recent cmake (3.17) and gfortran-7
# https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
# https://askubuntu.com/questions/949308/how-do-i-install-gfortran-7
# So need to install software-properties-common to add kitware repo https://askubuntu.com/questions/493460/how-to-install-add-apt-repository-using-the-terminal
# So need to install apt-transport-https https://unix.stackexchange.com/questions/263801/apt-get-fails-the-method-driver-usr-lib-apt-methods-https-could-not-be-found

RUN apt-get update && apt-get install -y doxygen \
                                         graphviz \
                                         libaec-dev \
                                         libz-dev \
                                         libsz2 && \
    apt-get install -y wget \
                       software-properties-common \
                       apt-transport-https && \
    wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - && \
    apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' && \
    apt-get update && apt-get install -y cmake && \
    add-apt-repository ppa:ubuntu-toolchain-r/test && \
    apt-get update && apt-get install -y gfortran-7 && \
    ln -f -s /usr/bin/gfortran-7 /usr/bin/gfortran
    
# Install also Python 3.7
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get install -y python3.7-dev

RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3.7 get-pip.py
RUN python3.7 -m pip install numpy colorama