美文网首页
Dockerfile中切换源

Dockerfile中切换源

作者: svmsunny | 来源:发表于2020-03-26 18:32 被阅读0次

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

相关文章

网友评论

      本文标题:Dockerfile中切换源

      本文链接:https://www.haomeiwen.com/subject/pnthuhtx.html