[Enhancement] Add pip source in dockerfile for `master` branch ()

* Add pip source

* Add pip source
pull/1493/head
HinGwenWoong 2022-12-06 19:46:01 +08:00 committed by GitHub
parent 2a1fed91c9
commit 7b3c3bc223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -43,6 +43,15 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini
/opt/conda/bin/conda install -y python=${PYTHON_VERSION} conda-build pyyaml numpy ipython cython typing typing_extensions mkl mkl-include ninja && \
/opt/conda/bin/conda clean -ya
### change the pip source for installing packages
RUN if [ ${USE_SRC_INSIDE} == true ] ; \
then \
/opt/conda/bin/pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple; \
echo "pip using tsinghua source" ; \
else \
echo "Keep pip the download source unchanged" ; \
fi
### pytorch
RUN /opt/conda/bin/pip install torch==${TORCH_VERSION}+cpu torchvision==${TORCHVISION_VERSION}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
ENV PATH /opt/conda/bin:$PATH

View File

@ -34,6 +34,15 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini
/opt/conda/bin/conda install -y python=${PYTHON_VERSION} conda-build pyyaml numpy ipython cython typing typing_extensions mkl mkl-include ninja && \
/opt/conda/bin/conda clean -ya
### change the pip source for installing packages
RUN if [ ${USE_SRC_INSIDE} == true ] ; \
then \
/opt/conda/bin/pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple; \
echo "pip using tsinghua source" ; \
else \
echo "Keep pip the download source unchanged" ; \
fi
### pytorch
RUN /opt/conda/bin/conda install pytorch==${TORCH_VERSION} torchvision==${TORCHVISION_VERSION} cudatoolkit=${CUDA} -c pytorch
ENV PATH /opt/conda/bin:$PATH