Apt-Get&Npm&Docker&PIP国内镜像

今天写Dockerflie的时候,国外的镜像慢的要死,需要国内的镜像,每次搜索有些麻烦,趁着有些时间就写下来。

Apt-Get

暂时收集debian,如需其他的镜像,点击网易或者阿里,里面有相应的镜像连接。

Debian

收集网易和阿里的镜像

debian 6.x (squeeze)

编辑/etc/apt/sources.list文件,管理员权限

deb http://mirrors.163.com/debian/ squeeze main non-free contrib
deb http://mirrors.163.com/debian/ squeeze-updates main non-free contrib
deb http://mirrors.163.com/debian/ squeeze-lts main non-free contrib
deb-src http://mirrors.163.com/debian/ squeeze main non-free contrib
deb-src http://mirrors.163.com/debian/ squeeze-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ squeeze-lts main non-free contrib
deb http://mirrors.163.com/debian-security/ squeeze/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ squeeze/updates main non-free contrib
deb http://mirrors.163.com/debian-backports/ squeeze-backports main contrib non-free
deb-src http://mirrors.163.com/debian-backports/ squeeze-backports main contrib non-free

deb http://mirrors.aliyun.com/debian/ squeeze main non-free contrib
deb http://mirrors.aliyun.com/debian/ squeeze-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ squeeze main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ squeeze-proposed-updates main non-free contrib

debian 7.x (wheezy)

编辑/etc/apt/sources.list文件,管理员权限

deb http://mirrors.163.com/debian/ wheezy main non-free contrib
deb http://mirrors.163.com/debian/ wheezy-updates main non-free contrib
deb http://mirrors.163.com/debian/ wheezy-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib
deb-src http://mirrors.163.com/debian/ wheezy-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ wheezy-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib

deb http://mirrors.aliyun.com/debian/ wheezy main non-free contrib
deb http://mirrors.aliyun.com/debian/ wheezy-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ wheezy main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ wheezy-proposed-updates main non-free contrib
            

debian 8.x (jessie)

编辑/etc/apt/sources.list文件,管理员权限

deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib

Npm Yarn

  • 淘宝npm:http://npm.taobao.org/
  • 淘宝npm registry:http://registry.npm.taobao.org/

使用方法

临时使用

npm --registry https://registry.npm.taobao.org install express

持久使用

npm config set registry https://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org

cnpm使用

npm install -g cnpm --registry=https://registry.npm.taobao.org

Docker 镜像站

  • DaoCloud:https://www.daocloud.io 通过注册可以得到加速器的地址,比如http://1d08e0e8.m.daocloud.io就是我得到的地址。

使用方法

Linux

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://1d08e0e8.m.daocloud.io

如果这个命令不行,到docker.service里面修改,不同的系统docker.service路径不一样,可以到根路径搜索。

find -name "docker.service"
#得到路径 通过vi命令修改 在ExecStart后面加上一句--registry-mirror=http://1d08e0e8.m.daocloud.io
ExecStart=xxxxxxxxxxxxxxxx    --registry-mirror=http://1d08e0e8.m.daocloud.io

Mac os

Docker For Mac

右键点击桌面顶栏的 docker 图标,选择 Preferences ,在 Daemon 标签(Docker 17.03 之前版本为 Advanced 标签)下的 Registry mirrors 列表中加入下面的镜像地址:

http://1d08e0e8.m.daocloud.io

点击 Apply & Restart 按钮使设置生效。

Windows

Docker For Windows

在桌面右下角状态栏中右键 docker 图标,修改在 Docker Daemon 标签页中的 json ,把下面的地址:

http://1d08e0e8.m.daocloud.io

加到"registry-mirrors"的数组里。点击 Apply 。

Pip镜像站

  • 豆瓣:http://pypi.douban.com/simple/
  • 清华:https://pypi.tuna.tsinghua.edu.cn/simple

使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow

以后遇到其他的镜像,我会回来完善本文。

你可能感兴趣的:(Apt-Get&Npm&Docker&PIP国内镜像)