Skip to content

Instantly share code, notes, and snippets.

@liujingcs
Last active October 29, 2020 12:32
Show Gist options
  • Save liujingcs/a4f5b5abd9de31e590568a0894ce7df1 to your computer and use it in GitHub Desktop.
Save liujingcs/a4f5b5abd9de31e590568a0894ce7df1 to your computer and use it in GitHub Desktop.
pengcheng_docker
# ==================================================================
# module list
# ------------------------------------------------------------------
# python 3.7 (miniconda)
# pytorch 1.3.0 (conda)
# ==================================================================
FROM nvidia/cuda:10.1-devel-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 build-essential && \
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=6.1 -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==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c 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 git+https://github.com/facebookresearch/fvcore && \
$PIP_INSTALL git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI && \
$PIP_INSTALL gpuinfo tensorboard jupyter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment