如何配置Docker使用国内镜像源加速,才能生效?-灵析社区

UX_siri

我执行docker info Registry Mirrors: https://ev9s0y223.mirror.aliyuncs.com/ https://docker.mirrors.ustc.edu.cn/ Live Restore Enabled: false WARNING: API is accessible on http://0.0.0.0:2375 without encryption. Access to the remote API is equivalent to root access on the host. Refer to the 'Docker daemon attack surface' section in the documentation for more information: https://docs.docker.com/go/attack-surface/ WARNING: No swap limit support WARNING: The devicemapper storage-driver is deprecated, and will be removed in a future release. Refer to the documentation for more information: https://docs.docker.com/go/storage-driver/ WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device. 已经可以看到镜像源了。 然后 sudo systemctl daemon-reload sudo systemctl restart docker 这两条也执行了。 但是,但是拉镜像的时候还是从docker.io拉, 请教各位大佬还有啥要处理的? { “registry-mirrors”:[“[https://ev9s0y223.mirror.aliyuncs.com/](https://link.segmentfault.com/?enc=4NFtZ7Aoto6m9nk7WW5adQ%3D%3D.ngpY45acnbPKjg4Uox4ZjKTuRQ45zGTUg8G5zUbYL17ZWyaJX6bYEp%2BjQlZ0IMnl)”] } 上面这个已配置,也重启了 sudo systemctl daemon-reload sudo systemctl restart docker 就想用国内的镜像源加速,现在安装太耗时了,随便就是几个小时!

阅读量:260

点赞量:0

问AI
阿里云的那个源本来就很慢,加上你要拉取的镜像很大。。。 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241002/15cc6e1c15c48c59b3c35332b4f2c44d.png) 怎么判断镜像源是不是生效了,可以打开docker的debug日志,然后pull镜像的时候看看日志,就知道是不是走了镜像源了。如果你看到日志里面是走了代理的地址拉取的镜像,还是慢,那就是镜像本身速度就很慢。 { "log-level": "debug", "registry-mirrors": ["https://xxx1.com","https://xxx2.com"] } 基本上现在国内没几个能用的镜像源了,要么也很慢,要么停止服务了。 我建议你有条件的话,配个代理,从代理下可能都比镜像快,我已经很久没用配过镜像了。