apt-get 通過dockerfile更換ubuntu鏡像中的源為阿里源
在dockerfile中增加如下步驟:
RUN sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list
&& sed -i s/security.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list
&& apt-get update && apt-get upgrade
pip3 換源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U # 將 pip 升級到最新版本
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple