Skip to content

Instantly share code, notes, and snippets.

@soumith
Created June 23, 2018 15:17
Show Gist options
  • Save soumith/84818f986db91428b73c78a5a70c3b6d to your computer and use it in GitHub Desktop.
Save soumith/84818f986db91428b73c78a5a70c3b6d to your computer and use it in GitHub Desktop.
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
WORKDIR /packages
RUN apt-get update --fix-missing && \
apt-get install -y cmake git wget bzip2 ca-certificates curl software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-7 libgfortran4 && \
apt-get clean
# Miniconda3 and Pytorch dependencies Install
#ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
#ENV TORCH_CUDA_ARCH_LIST="All"
RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
conda install numpy pyyaml setuptools cmake cffi typing mkl mkl-include && \
conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
#RUN wget --quiet -O ~/miniconda.sh && \
# /bin/bash ~/miniconda.sh -b -p /opt/conda && \
# rm ~/miniconda.sh && \
# /opt/conda/bin/conda clean -tipsy && \
# ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
# echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
# echo "conda activate base" >> ~/.bashrc && \
# . ~/.bashrc
# Install PyTorch from Source
RUN export CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" && \
git clone --recursive https://github.com/pytorch/pytorch && \
cd pytorch && \
python setup.py clean && \
python setup.py install
# Install Tini
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-ppc64el /usr/bin/tini
RUN chmod +x /usr/bin/tini
ENTRYPOINT [ "/usr/bin/tini", "--" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment