Troubleshooting: Docker Hub Rate Limits During Build
Docker Hub has limits on the amount of pulls unauthenticated users can do. This often affects AWS users of CodeBuild because it’s a shared service and many other AWS users are pulling from Docker Hub too.
This typically manifests itself with failing builds due to the following error:
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: [https://www.docker.com/increase-rate-limit](https://www.docker.com/increase-rate-limit)
There are two solutions to this problem.
Solutions
- Option 1: Create a Docker Hub account and add the
DOCKER_USERNAME
andDOCKER_PASSWORD
environment variables in Flightcontrol, learn more on how to add environment variables to your project here - Option 2: Use AWS Elastic Container Registry (ECR) public images instead of using the Docker Hub. ECR supports unlimited free pulls from AWS resources, check the ECR Public Gallery which includes all the major docker providers