anchor.diff:  
   EXPOSE 22
   ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
  -CMD ["/usr/sbin/sshd","-eD", "-f", "/.sshd/user_keys/root/sshd_config"]
  +CMD ["/usr/sbin/sshd","-eD", "-f", "/.sshd/user_keys/root/sshd_config"]
positive.code: FROM python:3.6-alpine
  
  # Install build deps, then run `pip install`, then remove unneeded build deps all in a single step. Correct the path to your production requirements file, if needed.
  RUN set -ex \
      && echo http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \
      && apk add --no-cache --virtual .build-deps \
              gcc \
              make \
              libc-dev \
              musl-dev \
              linux-headers \
              pcre-dev \
      && apk add --no-cache \
              openmpi \
              #supervisor \
              openssh \
      && apk del .build-deps
  
  RUN apt-get update && apt-get install -y \
      g++ 
  
  RUN cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \
      echo "    StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \
      mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config
  
negative.code:   chown -R $SSH_USER:$SSH_USER /.sshd/user_keys/$SSH_USER && chmod 700 /.sshd/user_keys/$SSH_USER
  VOLUME /ssh-key/$SSH_USER
  
  # -------------------- Conda environment --------------------
  RUN curl -o ~/miniconda.sh -O  https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  && \
       sh ~/miniconda.sh -b -p /conda
  ENV PATH /conda/bin:$PATH
  ENV LD_LIBRARY_PATH /conda/lib:$LD_LIBRARY_PATH
  
  RUN conda install -y -c anaconda numpy pyyaml scipy mkl setuptools cmake cffi mkl-include typing
  RUN conda install -y -c mingfeima mkldnn
  # RUN conda install -y -c conda-forge openmpi
  
  # -------------------- Open MPI --------------------
  RUN mkdir /.openmpi/
  RUN wget https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.0.tar.gz
  RUN gunzip -c openmpi-3.0.0.tar.gz | tar xf - \
      && cd openmpi-3.0.0 \
      && ./configure --prefix=/.openmpi/ \
      && make all install
  
  ENV PATH /.openmpi/bin:$PATH
  ENV LD_LIBRARY_PATH /.openmpi/lib
  
  RUN mv /.openmpi/bin/mpirun /.openmpi/bin/mpirun.real && \
      echo '#!/bin/bash' > /.openmpi/bin/mpirun && \
      echo "/.openmpi/bin/mpirun.real" '--allow-run-as-root "$@"' >> /.openmpi/bin/mpirun && \
      chmod a+x /.openmpi/bin/mpirun
  
  # Configure OpenMPI to run good defaults:
  #   --bind-to none --map-by slot --mca btl_tcp_if_exclude lo,docker0
  RUN echo "hwloc_base_binding_policy = none" >> /.openmpi/etc/openmpi-mca-params.conf && \
      echo "rmaps_base_mapping_policy = slot" >> /.openmpi/etc/openmpi-mca-params.conf && \
      echo "btl_tcp_if_exclude = lo,docker0" >> /.openmpi/etc/openmpi-mca-params.conf
  
  # configure the path.
  RUN echo export 'PATH=$HOME/conda/envs/pytorch-py$PYTHON_VERSION/bin:$HOME/.openmpi/bin:$PATH' >> ~/.bashrc
  RUN echo export 'LD_LIBRARY_PATH=$HOME/.openmpi/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
  
  
  # -------------------- PyTorch --------------------
  ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
  
  # Install basic dependencies
  RUN git clone --recursive https://github.com/pytorch/pytorch && cd pytorch && python setup.py install
  
  # -------------------- Debug --------------------
  RUN apt-get install -y vim net-tools
  
  
  
  # -------------------- Others --------------------
  RUN echo "orte_keep_fqdn_hostnames=t" >> /.openmpi/etc/openmpi-mca-params.conf
  
  ADD ./compose/worker/entrypoint.sh /usr/local/bin/
  RUN chmod a+x /usr/local/bin/entrypoint.sh
  
  