[Enhancement] Add pip source in dockerfile for `master` branch (#1492)
* Add pip source * Add pip sourcepull/1493/head
parent
2a1fed91c9
commit
7b3c3bc223
docker
CPU
GPU
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue