My build fails to pull Docker image with "Too Many Requests" - Rate Limiting by Docker Hub

 

Docker Hub Rate Limiting

As of November 1, 2020, Docker Hub enabled rate limits based on the originating IP address. Since CircleCI runs jobs from a shared pool of IPs, it is strongly recommended to use authenticated Docker pulls with Docker Hub to avoid encountering rate limits.

Identifying this error can be done by examining the Spin Up Environment step of your build output for a toomanyrequests:Too Many Requests error message.

Solutions

Using authentication for Docker Hub in your builds is the best way to avoid being rate limited for Docker image Pulls. The first suggestion is to create a Context for your Docker Hub credentials to incorporate in your config.yml.

Example config: 

context-example

You may also use a per-project Environment Variables as shown here.

project-level-env-var

Alternative solutions can also be found here in our Documentation here.

Below is an example of a build failure due to encountering the Docker rate limit.

screenshot

Was this article helpful?
3 out of 9 found this helpful

Comments

0 comments

Article is closed for comments.