Skip to content

Instantly share code, notes, and snippets.

@chenyaofo
Last active June 24, 2020 02:01
Show Gist options
  • Save chenyaofo/a9a9a03b0a1d719f23942c3fcb4482a5 to your computer and use it in GitHub Desktop.
Save chenyaofo/a9a9a03b0a1d719f23942c3fcb4482a5 to your computer and use it in GitHub Desktop.
pytorch1.3-py37
FROM nvidia/cuda:10.2-runtime-ubuntu18.04
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
GIT_CLONE="git clone --depth 10" && \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse' > /etc/apt/sources.list && \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list && \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list && \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list && \
cat /etc/apt/sources.list && \
rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL wget bzip2 graphviz git openssh-server && \
apt-get clean
RUN wget --quiet https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
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 && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
/opt/conda/bin/conda clean -afy
RUN CONDA_INSTALL="/opt/conda/bin/conda install -y" && \
/opt/conda/bin/conda config --set show_channel_urls yes && \
$CONDA_INSTALL ipdb pyhocon glances -c conda-forge && \
$CONDA_INSTALL setuptools cython future ipython && \
$CONDA_INSTALL pytest graphviz jinja2 && \
$CONDA_INSTALL accimage pillow -c conda-forge && \
$CONDA_INSTALL scipy numpy scikit-learn pandas matplotlib && \
/opt/conda/bin/conda clean -ay
RUN CONDA_INSTALL="/opt/conda/bin/conda install -y" && \
$CONDA_INSTALL pytorch torchvision cudatoolkit=10.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch && \
/opt/conda/bin/conda clean -ay
RUN PIP_INSTALL="/opt/conda/bin/pip --no-cache-dir install --upgrade" && \
/opt/conda/bin/pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple && \
$PIP_INSTALL tb-nightly && \
$PIP_INSTALL pycocotools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment