Dealing with DockerHub rate limit on AWS CodeBuild
Docker pulls has a rate-limit of 100-200 pulls per six hours. This limit exceeds much faster than you think.
February 12, 2024
Docker on AWS CodeBuild sometimes gives the following error.
According to the link given in the error, it should reset
every 6 hours. However, in my case it didn't reset even after 12 hours.
An AWS blog post
recommends two ways to deal with this situation.
Copying Docker Images to ECR Private Repositories
Consideration of Paid Docker Plans
Let's delve into the first method:
Step 1: Transferring Docker Image to ECR Private Repository
Login to the AWS console and start the CloudShell (located in the top navigation bar). Then execute the following
commands one by one. Make sure to update the image name, AWS account ID, and the platform parameter before doing that.
$AWS_DEFAULT_REGION resolves to your current AWS region in the CloudShell.