python官方鏡像是基於debian的。國內使用時定製一下,加快下載速度。python
dockfile中:docker
#國內debian源ADD sources.list /etc/apt/
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 contriburl
#用國內源加速大包的安裝COPY pip.conf /etc/pip.conf
pip.confip
[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple