Skip to content

Instantly share code, notes, and snippets.

@mgnisia
Created January 16, 2020 18:04
Show Gist options
  • Save mgnisia/42828d1e49c0ac580e5e7dbe1076b66b to your computer and use it in GitHub Desktop.
Save mgnisia/42828d1e49c0ac580e5e7dbe1076b66b to your computer and use it in GitHub Desktop.
Dockerfile for gcc with mpi, python3, numpy and pandas, Application: CI testing of MPI code
FROM gcc
# Install MPI
ENV MPI_VERSION 3.3.1
RUN wget http://www.mpich.org/static/downloads/${MPI_VERSION}/mpich-${MPI_VERSION}.tar.gz &&\
tar xfz mpich-${MPI_VERSION}.tar.gz &&\
cd mpich-${MPI_VERSION} &&\
./configure &&\
make -j 4 &&\
make -j 4 install
# Add python3 numpy and python
RUN apt-get -yq update &&\
apt-get -yq upgrade &&\
apt-get install -yq software-properties-common &&\
apt-get install -yq python3 python3-pip &&\
pip3 install numpy pandas
# Add user to prevent root executing the mpi processes
RUN useradd -mrs /bin/bash mpi -p mpi
USER mpi
WORKDIR /home/mpi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment