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