I got stuck on Docker Hub while building Docker with CodeBuild. It was easy to get around with the new AWS service ECR Public.
When I tried to build a Docker container with ubuntu
as the base image with CodeBuild, the following error occurred.
error pulling image configuration: toomanyrequests: Too Many Requests. Please see https://docs.docker.com/docker-hub/download-rate-limit/
Docker Hub has recently set a limit on the number of downloads. The number of downloads is limited for each global IP/account (if you log in). The article by Class Method is detailed. Build fails with “Too Many Requests.”…. Log in to Docker Hub to avoid IP gachas on AWS CodeBuild! Story
(I thought that Docker Hub authentication was troublesome ...) Just because AWS started to provide a service ECR Public
that is an alternative to Docker Hub, I decided to use this.
[Breaking News] AWS Launches "Amazon Elastic Container Registry Public" Aiming to Replace Docker Hub. AWS re: Invent 2020 AWS announces alternative service for Docker Hub. You can publish the container image to the public, free up to 50GB, you can pull as many times as you want from AWS
Compared to the pattern of putting authentication in Docker Hub,
I decided that there is a merit.
When you access ECR Public, it seems that the main official images are registered. (I haven't confirmed everything)
Since there is an ImageURI (the tag structure is the same as DockerHub), just rewrite from of DockerFile.
FROM public.ecr.aws/ubuntu/ubuntu:bionic
Apparently, exactly the same thing as Docker Hub is hosted (it was the same hash, Docker cache also worked), and it worked just by rewriting it.
When I looked at the nginx Docker repository, there was a script that automatically pushes to ECR Public.
I've only used it for a while, but it seems that ECR Public can be used as an alternative to Docker Hub as an official image source. Especially if you are using the AWS environment, it seems to be especially useful because there are no particular restrictions.
Recommended Posts