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