If your development team or CI/CD pipeline suddenly starts receiving the error
toomanyrequests: You have reached your pull rate limit,
it means Docker Hub has applied a restriction to your IP address. This is particularly painful in offices with a shared external IP, on CI/CD servers,
and during automated builds where dozens of containers pull images simultaneously. In this article, we will discuss how to set up a proxy
at various levels — from Docker Desktop to the systemd daemon on a production server — to distribute the load and avoid bans.
Why Docker Hub limits docker pull
In 2020, Docker Inc. introduced Rate Limits for free accounts and anonymous requests to reduce the load on infrastructure and encourage users to switch to paid plans. The limit is calculated not by account but by the originating IP address — meaning if an entire office, CI/CD server, or Kubernetes cluster is behind NAT, all requests are summed into one counter. A poorly configured pipeline that rebuilds images every few minutes can "consume" the limit for the entire team in just a couple of hours.
The problem is exacerbated in auto-scaling environments: Kubernetes nodes, GitLab Runners, GitHub Actions self-hosted — all of them may operate from a single pool of IP addresses from a cloud provider, where the limit has already been partially exhausted by other clients in the same data center. As a result, builds fail not due to a code error but because of an infrastructure limitation that the developer cannot directly influence — except by changing the outgoing IP.
Current limits in effect
Docker Hub periodically changes the exact figures, but the principle remains the same: anonymous requests are limited the most, authorized free accounts receive some leniency, and paid plans — significantly more requests or even no limit on pulls. Below is an approximate structure of restrictions, current at the time of writing this article.
| Access Type | Pull Request Limit | Period |
|---|---|---|
| Anonymous (by IP) | ~100 pulls | 6 hours |
| Free account (authenticated) | ~200 pulls | 6 hours |
| Pro / Team | Significantly higher / no limit | — |
Logging into an account raises the limit but does not solve the problem of a shared IP for a team of 20+ people or for dozens of parallel jobs in CI. This is where proxies come into play: by distributing traffic across different outgoing IPs, you can effectively bypass the limit without changing the pipeline architecture.
Which type of proxy to choose for Docker Hub
When working with Docker Hub, anonymity in the classic sense is not as important as connection stability and a sufficient number of unique IPs for load distribution. Different scenarios require different types of proxies.
| Scenario | Recommended Type | Why |
|---|---|---|
| CI/CD with high build frequency | Datacenter Proxies | High speed, low latency, stable uptime for mass pull requests |
| Bypassing strict blocking of datacenter ranges | Residential Proxies | Real IPs from providers that are not associated with clouds |
| Testing pulls from different regions | Mobile Proxies | Suitable for checking geo-dependent behavior of the registry |
For most teams that simply want to lift the limit on mass image downloads in CI/CD or on build servers, datacenter proxies are sufficient — they provide maximum speed with minimal latency, which is critical when pulling dozens of image layers in parallel.
Configuring proxy in Docker Desktop
If you are working on Windows or macOS through Docker Desktop, the proxy is configured through the graphical interface without manually editing configuration files.
- Open Docker Desktop → Settings (gear icon)
- Go to Resources → Proxies
- Enable Manual proxy configuration
- Enter the address in the Web Server (HTTP) and Secure Web Server (HTTPS) fields in the format
http://login:password@proxy_ip:port - Add exceptions in the Bypass field if you need to access local registries directly
- Click Apply & Restart
After restarting, all daemon requests, including docker pull
and docker build, will go through the specified proxy.
You can check this with the command:
docker info | grep -i proxy
Proxy at the Docker daemon level (Linux)
On Linux servers (Ubuntu, Debian, CentOS), Docker runs as a systemd service, and the proxy is configured through
an override configuration file for the daemon, not through environment variables in ~/.bashrc —
this is important because systemd does not inherit user environment variables.
Create the directory and configuration file:
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
Insert the following content:
[Service]
Environment="HTTP_PROXY=http://login:password@proxy_ip:8080"
Environment="HTTPS_PROXY=http://login:password@proxy_ip:8080"
Environment="NO_PROXY=localhost,127.0.0.1,.internal.company.com"
Apply the changes and restart the daemon:
sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl show --property=Environment docker
The last command will output the environment variables applied to the Docker service — make sure the proxy is correctly specified before running mass image pulls.
Proxy in docker-compose and image builds
Configuring the daemon solves the problem for docker pull,
but for building images through Dockerfile
the proxy needs to be passed separately through build arguments; otherwise, steps inside the image (e.g., apt-get
or pip install) will not see the host's proxy settings.
docker build \
--build-arg HTTP_PROXY=http://login:password@proxy_ip:8080 \
--build-arg HTTPS_PROXY=http://login:password@proxy_ip:8080 \
--build-arg NO_PROXY=localhost,127.0.0.1 \
-t myapp:latest .
For docker-compose, similar parameters are specified in the service file:
services:
app:
build:
context: .
args:
HTTP_PROXY: "http://login:password@proxy_ip:8080"
HTTPS_PROXY: "http://login:password@proxy_ip:8080"
NO_PROXY: "localhost,127.0.0.1"
image: myapp:latest
If the proxy requires IP-based authorization rather than login and password, ensure that your build server is included in the list of allowed addresses on the proxy provider's side — otherwise, requests will be dropped with a 407 error.
Registry mirror as an additional layer of protection
A proxy removes the limit on the number of requests but does not speed up the download of the same base images (nginx, postgres, python) every time from scratch. The solution is to set up a local registry mirror or pull-through cache that caches image layers and only queries Docker Hub when the required version is not in the cache. This reduces the overall number of requests through the proxy and speeds up CI/CD.
Add the mirror to the daemon configuration /etc/docker/daemon.json:
{
"registry-mirrors": ["https://mirror.gcr.io"],
"proxies": {
"http-proxy": "http://login:password@proxy_ip:8080",
"https-proxy": "http://login:password@proxy_ip:8080",
"no-proxy": "localhost,127.0.0.1"
}
}
After modifying the file, run sudo systemctl restart docker.
The combination of a registry mirror and a proxy is the optimal solution for teams that build dozens of images a day and want
to minimize both delays and the risk of exhausting the limit.
Proxy rotation for CI/CD and large pipelines
If you have hundreds of parallel jobs in GitLab CI, GitHub Actions self-hosted runners, or Jenkins agents, a single proxy may not be sufficient — all requests will again hit the limit of the single outgoing IP. In this case, a pool of proxies with rotation is used: each runner or job gets its own IP from the pool, which evenly distributes the load and prevents hitting the Docker Hub limit.
A simple example of a script that selects a random proxy from a list before starting a pull in the runner:
#!/bin/bash
PROXIES=("http://user:pass@ip1:8080" "http://user:pass@ip2:8080" "http://user:pass@ip3:8080")
RANDOM_PROXY=${PROXIES[$RANDOM % ${#PROXIES[@]}]}
export HTTP_PROXY=$RANDOM_PROXY
export HTTPS_PROXY=$RANDOM_PROXY
docker pull myregistry/myimage:latest
For production environments, instead of a static list, it is better to use a proxy with automatic rotation on the provider's side — this eliminates the need to manually manage the pool of addresses and prevents situations where some IPs have already been temporarily banned by Docker Hub.
Common errors and their solutions
| Error | Cause | Solution |
|---|---|---|
| toomanyrequests: pull rate limit | Limit exhausted on the current IP | Set up a proxy at the daemon level or use a rotating pool |
| 407 Proxy Authentication Required | Invalid credentials or IP not in whitelist | Check login/password, add server IP to the allowed list |
| Proxy configured but not applied during build | Variables not passed as build-arg | Add --build-arg HTTP_PROXY/HTTPS_PROXY to the build command |
| systemd ignores environment variables | Variables set in .bashrc, not in the override file | Use /etc/systemd/system/docker.service.d/http-proxy.conf |
Conclusion
The Rate Limit of Docker Hub is an infrastructure limitation that primarily affects teams with a shared outgoing IP: office networks, cloud CI/CD runners, and Kubernetes clusters. The solution does not require changing the registry or purchasing a Pro plan — simply configure a proxy at the Docker daemon level, pass it in build arguments for image builds, and if necessary add a registry mirror for caching frequently used base images. For large pipelines with hundreds of parallel jobs, it makes sense to use a rotating proxy pool to evenly distribute requests and avoid hitting the limit again.
If your infrastructure actively pulls images from Docker Hub on a regular basis, consider using datacenter proxies — they provide minimal latency and high bandwidth, which is critical when downloading many layers of images in parallel. For cases where datacenter ranges have already come under suspicion from the registry, consider using residential proxies — they use real IP addresses from internet providers and are less likely to trigger additional checks.