2 Answers
- Newest
- Most votes
- Most comments
2
This error occurs when pulling Docker images from DockerHub when starting a new build in CodeBuild. It is due to a limit set by Dockerhub to restrict access for Docker public registries. For anonymous users, as in your situation, the limit is 100 pulls every 6 hours per IP address.
To address this concern, you can consider enabling Docker layer cache in CodeBuild. The steps are:
- Open your codeBuild project in CodeBuild console and click on "Edit"
- Under "Artifacts" section, expand "Additional configuration"
- In "Cache type", choose "Local"
- Select "Docker layer cache"
- Apply the settings by selecting "Update project"
Another option is to authenticate to DockerHub. This will increase your rate limit to 200 pulls per 6 hour period as stated in DockerHub Download rate limit.
0
Workaround is to use ECR:
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
So you can use something like this: (some fields are empty)
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region:
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY:
ECR_REPOSITORY:
IMAGE_TAG:
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
answered a year ago
Relevant content
- Accepted Answerasked 3 years ago
- asked 5 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago