dockerfile debian 和pip使用国内源


python官方镜像是基于debian的。国内使用时定制一下,加快下载速度。

1 debian本身使用国内源

dockfile中:

#国内debian源
ADD sources.list /etc/apt/
sources.list在dockerfile同目录下:

deb http://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib
deb http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main non-free contrib

2 pip使用国内源

#用国内源加速大包的安装
COPY pip.conf /etc/pip.conf

pip.conf

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM