Configuring Amazon ECR to Work with Docker
An Amazon ECR pull-through cache pointed to Docker Hub allows you to cache Docker Hub images in your Amazon Elastic Container Registry (ECR). This setup helps to reduce the dependency on Docker Hub by storing frequently used images locally in your ECR, which can improve performance and reliability, especially during high traffic periods or when Docker Hub rate limits are in effect.
Use the following procedure to configure an Amazon ECR pull-through cache for Docker.
To configure an Amazon ECR pull-through cache to work with Docker
1. In AWS, navigate to
AWS CER > Features and Settings > Pull through cache.
2. Click the Add rule button.
3. In the Registry menu, select Docker Hub.
4. In the
Configure authentication page, perform the following:

A. If you have an existing secret, select Use an existing AWS secret and select the secret from a list. If you do not have a secret, then select Create an AWS secret and specify a name for your secret.
B. In Docker Hub Username, enter your Docker Hub user account name.
C. In Docker Hub Access token, do NOT enter your Docker Hub password. This field requires an access token. Create the token in Docker Hub > Account settings > Security > Personal access tokens > Generate new token. Ensure you create the token as read-only.
D. After completing all fields, click Next.
5. Specify the repository prefix name.

The repository prefix must be between 2 and 20 characters. Click
Next when done.
6. In
Review and Create, verify the configuration and then click the
Create button.

7. You have now configured an ECR pull-through cache for Docker. Select from one of the following two options to continue installation: