docker构建换源apt-get换源pip换源

 

macOS docker for desktop 换源

 

 

 

 

{
  "debug": true,
  "experimental": false,
  "registry-mirrors": [
    "https://docker.mirrors.ustc.edu.cn",
    "https://hub-mirror.c.163.com"
  ]
}

 

apt-get换源

RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list

 

pip换源

新建pip.conf

[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

在构建文件中

COPY ./pip.conf /root/.pip/pip.conf

 

posted @ 2021-12-13 21:29  希希大队长  阅读(611)  评论(0编辑  收藏  举报