AWS › Elastic Container Registry (ECR)

How can ECR pull through cache repositories simplify managing dependencies on public container registries while maintaining private, controlled access?

Advanced

Answer

ECR pull through cache lets you create a private ECR repository that automatically caches images pulled from an upstream public registry, such as Docker Hub or the AWS public ECR gallery, the first time they are requested, meaning subsequent pulls of the same image are served from your own private, faster ECR cache rather than repeatedly hitting the external public registry, which also helps avoid public registry rate limiting issues that can otherwise disrupt CI/CD pipelines.
aws ecr create-pull-through-cache-rule --ecr-repository-prefix docker-hub --upstream-registry-url registry-1.docker.io
Real-world example A company experiencing intermittent CI/CD pipeline failures due to Docker Hub rate limiting sets up an ECR pull through cache, ensuring all subsequent builds pull common base images from their own private, reliable ECR cache instead of directly hitting the public registry every single time.

Common follow-ups: What upstream registries are supported for ECR pull through cache?;How does pull through cache interact with ECR lifecycle policies for cached images?