再docker拉取镜像时,花费时间太长。用如下方法可以解决:
[root@localhost ~]# mkdir -p /etc/docker
[root@localhost ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://9cpn8tt6.mirror.aliyuncs.com"]
}
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
之后重新拉取,或者拉取新的镜像,速度就会快很多。
问题原因:
国内访问国外的网站会特别慢。将其换成阿里源就会好很多。