登陸阿里云鏡像倉(cāng)庫(kù) https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
如果沒有阿里云賬號(hào),需要注冊(cè)一個(gè),并開通個(gè)人版的容器鏡像服務(wù)即可
找到自己的鏡像加速器地址,然后按照如下方法操作 [root@xianchaomaster1 ~]#vim /etc/docker/daemon.json,變成如下
{ "registry-mirrors":[ "https://fgx99taj.mirror.aliyuncs.com", "https://docker.lmirror.top","https://docker.m.daocloud.io", "https://hub.uuuadc.top", "https://docker.anyhub.us.kg", "https://dockerhub.jobcher.com", "https://dockerhub.icu", "https://docker.ckyl.me", "https://docker.awsl9527.cn", "https://docker.laoex.link"], "insecure-registries":["192.168.40.62","harbor" ] }
注意:https://fgx99taj.mirror.aliyuncs.com 是自己阿里云賬號(hào)個(gè)人的加速網(wǎng)址,全球唯一
讓配置文件生效 [root@xianchaomaster1 ~]#systemctl daemon-reload [root@xianchaomaster1 ~]#systemctl restart docker
[root@xianchaomaster1 ~]# docker pull nginx
如果無(wú)法拉起,可能是加速域名失效
查看已經(jīng)成功拉下來(lái)的nginx鏡像文件如下:
docker images
