背景描述
从官方的 docker.io 拉取镜像显示:
Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
原因
从 2020-11-02 开始,官方的 Docker Hub 开始对 pull 请求加上了限制,限制为匿名用户(未登录),每 6 小时只能拉 100 次 image,登录的免费用户每 6 小时拉 200 次 镜像。
登录官方仓库
[root@c7-4 ~/kubesphere]#docker login docker.io
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: shenyuanhaojie
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
PS:对于登录而言,限制的是用户,对于未登录的用户而言,限制的是 IP。如果是虚拟机,多个虚拟机走的是一个 公网 IP 对外,未登录的用户都会被限制。