Dockerfile 指定 pip 安装源

Dockerfile 指定 pip 安装源

Dockerfile使用的python3.7作为基础镜像 FROM python:3.7,但是执行
RUN pip install --no-cache-dir -r requirements.txt
是默认走了这个源,https://files.pythonhosted.org/packages,编译用时太久。

修改成国内源来加快编译速度:

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r requirements.txt
原文地址:https://www.cnblogs.com/kai-/p/13457800.html