1 ARG DEBIAN_FRONTEND="noninteractive" 2 3 # install mpich, openssh for MPI to communicate between containers 4 RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ 5 mpich \ 6 libmpich-dev \ 7 openssh-client \ 8 openssh-server && \ 9 apt-get clean && \ 10 rm -rf /var/lib/apt/lists/* 11 12 # Create a wrapper for MPICH to allow running as root by default 13 RUN mv /usr/bin/mpirun /usr/bin/mpirun.real && \ 14 echo '#!/bin/bash' > /usr/bin/mpirun && \ 15 echo 'mpirun.real "$@"' >> /usr/bin/mpirun && \ 16 chmod a+x /usr/bin/mpirun 17 18 # Disable GCC noise for gcc newer than 5.x, otherwise Horovod installation fails 19 RUN sed -i 's/# if __GNUC__ > 5/# if __GNUC__ > 9/g' /usr/include/mpich/mpicxx.h 20 21 22 # Set up SSH 23 RUN mkdir -p /var/run/sshd 24 25 # Allow OpenSSH to talk to containers without asking for confirmation 26 RUN cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \ 27 echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \ 28 mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config