## TL;DR

Fix it by authenticating pulls with Docker Hub credentials in the build project, or by hosting the image in ECR (or ECR Public) and referencing that instead. Caching the image or using a custom CodeBuild image stored in ECR avoids repeated anonymous pulls entirely.

## Steps

1. [Stack Overflow q65806330]: 'You have reached your pull rate limit' during a CodeBuild build means the build environment pulled a base image anonymously from Docker Hub too many times. Fix it by authenticating pulls with Docker Hub credentials in the build project, or by hosting the image in ECR (or ECR Public) and referencing that instead. Caching the image or using a custom CodeBuild image stored in ECR avoids repeated anonymous pulls entirely.

## When to use

You are seeing this: [Stack Overflow q65806330]: 'You have reached your pull rate limit' during a CodeBuild build means the build environment pulled a base image anonymously from Docker Hub too many times. Use this skill when you run into "CodeBuild TooManyRequestsException on pull: you hit the public registry rate limit".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
