Configuring ECR and a Docker Image
Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service provided by AWS. It allows you to store, manage, and deploy Docker container images and OCI (Open Container Initiative) compatible artifacts.
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.