Recently, one of our pipelines failed during the construction phase due to the following error:
“Toomanyrequests: You have reached the rate limit. You can increase the limit through authentication and upgrade: https://www.docker.com/increase-rate-limit”.
We noticed that when trying to extract the Docker File Base image from Docker Hub, the build failed during the docker build phase. as follows.
This article describes how to resolve such errors. This article assumes that we are using AWS Cloud Platform.
- An AWS account.
- A user is created on this account, and the user has permissions to configure account resources and access CloudWatch.
- ECR registration center.
Pull the image from Docker Hub and push it to the local registry
Use the following command to extract the image from Docker Hub and push it to the local registry. For this situation, we created an ECR registry on the AWS cloud platform.
$ docker pull ubuntu:18.04 $ docker images
This is the output of my command.Docker pull
Log in to your ECR registration form.
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 429758582529.dkr.ecr.eu-central-1.amazonaws.com
Where 429758582529.dkr.ecr.eu-central-1.amazonaws.com is the ECR repository URL.
Then mark the image and push it to the registry:
docker tag ubuntu:18.04 429758582529.dkr.ecr.eu-central-1.amazonaws.com/ubuntu18:latest docker push 429758582529.dkr.ecr.eu-central-1.amazonaws.com/ubuntu18:latest
Screenshot of my output.Docker tags and pushDocker image has been pushed to the ECR registry
Edit DockerFile to extract the base image from the local registry
On the Docker file, replace the base image with the ECR registry URI. See the sample Docker File below.
FROM 429758582529.dkr.ecr.eu-central-1.amazonaws.com/ubuntu18 # Install nginx RUN apt-get update && apt-get install -y nginx # Install php and supervisor RUN apt-get update && apt-get -y upgrade && apt-get -y autoremove && apt-get install -y php-fpm php-curl supervisor && apt-get clean
Now that you have resolved the issue, your pipeline will continue to work as usual.
Happy Building! ! !