在Debian8上安装Docker并加速
Docker有啥好处?先安装了再说。
安装方法: 按照这个 安装步骤文档 做就好了。
关键是,中国需要加速, 方法有2:
- 注册 daocloud 帐号, 然后在 daocloud加速文档 获取加速方法。
- 注册 阿里云 帐号,然后在 阿里云文档 获取加速域名。
本质上,两种加速方法是类似的,daocloud和阿里云分别给注册的帐号绑定一个加速域名,放在 /etc/docker/daemon.json 里面,参考 dockerd文档 中关于 –registery-mirror的说明。 /etc/docker/daemon.json 内容为如下形式(需要替换两处<>中的内容)
{
"registry-mirrors": ["http://<yourdaocloudacc>.m.daocloud.io", "https://<youraliyun>.mirror.aliyuncs.com"]
}
daocloud和阿里云加速可单独使用,也可混合使用。