Write by lyc at 2020-4-17

docker 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。

DaoCloud镜像站:https://www.daocloud.io/mirror

A1.配置DaoCloud镜像加速器

1
2
$ curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
$ systemctl restart docker

A2.查看验证

1
2
3
4
$ cat /etc/docker/daemon.json
{
"registry-mirrors": ["http://f1361db2.m.daocloud.io"]
}

B1.配置阿里云docker镜像加速器

1
2
3
4
5
$ cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"]
}
EOF