Newer
Older
# Build a Docker image that contains all requirements to run the PyCIF CI.
FROM ubuntu:20.10
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common rsync git \
&& apt update \
# Install Python
&& DEBIAN_FRONTEND=noninteractive apt install -y python3.9 python3-pip \
# Install GDAL
&& apt-get install -y gdal-bin libgdal-dev \
&& pip install numpy GDAL \
# Install important packages
&& DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential xmlstarlet gfortran libeccodes0 graphviz \
&& pip install scipy tox==3.23.1 sphinx sphinxcontrib-plantuml graphviz \
pyproj cython numpy pandas matplotlib==3.3.4 bottleneck \
# Install MPI
&& apt-get install -y libopenmpi-dev openmpi-bin libhdf5-openmpi-dev \
# Install NetCDF
&& cd /tmp \
&& apt install -y wget \
&& wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.5.3.tar.gz \
&& tar -xf netcdf-fortran-4.5.3.tar.gz \
&& cd netcdf-fortran-4.5.3 \
&& ./configure --prefix=${NCDIR} --disable-netcdf-4 \
&& make install;
# Install utilities for TM5
RUN apt-get install -y tcsh bison flex openjdk-8-jdk\
&& mkdir -p /usr/local/gfortran;
# Copy libraries and compile them
COPY ./TM5_libs /tmp/TM5_libs
WORKDIR /tmp/TM5_libs
RUN ./INSTALL_ALL.sh
# Install python packages to install pycif locally
RUN apt update \
&& apt-get install -y python3-yaml \
&& pip install pytest pytest-html pyyaml virtualenv==20.4.7;
# Install pycif on the container
COPY ./ /tmp/CIF
WORKDIR /tmp/CIF/
RUN python3 setup.py develop
# Command to run at execution
COPY ./bin/docker_entrypoint.sh /bin/
# Create directories
RUN mkdir /workdir/ \
&& mkdir /config/;
ENTRYPOINT ["docker_entrypoint.sh"]