DEV Community

Soushi Hiruta
Soushi Hiruta

Posted on

ECR can create automaticaly when image pushed

ECR can create automaticaly when image pushed

Update

https://aws.amazon.com/about-aws/whats-new/2025/12/amazon-ecr-creating-repositories-on-push/

Repository Create Template

Frist need to create Repository Create template.

Specific Prefix ECR Automaticaly create or You can create any repository.

Whether to overwrite image tags or not can be set at the template creation stage.

Try

docker buildx build -t test-auto-create --platform=linux/amd64 .

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin xxxxxxxxxxxx.dkr.ecr.us-west-2.amazonaws.com

docker tag 3413614e55cd xxxxxxxxxxxx.dkr.ecr.us-west-2.amazonaws.com/test-auto-create:latest

docker push xxxxxxxxxxxx.dkr.ecr.us-west-2.amazonaws.com/test-auto-create:latest
Enter fullscreen mode Exit fullscreen mode

I verified this by running the aws ecr describe-repositories command before and after. You should be able to see that the ECR is created.

3a4,17
>             "repositoryArn": "arn:aws:ecr:us-west-2:xxxxxxxxxxxx:repository/test-auto-create",
>             "registryId": "xxxxxxxxxxxx",
>             "repositoryName": "test-auto-create",
>             "repositoryUri": "xxxxxxxxxxxx.dkr.ecr.us-west-2.amazonaws.com/test-auto-create",
>             "createdAt": "2025-12-21T12:39:57.362000+09:00",
>             "imageTagMutability": "IMMUTABLE",
>             "imageScanningConfiguration": {
>                 "scanOnPush": false
>             },
>             "encryptionConfiguration": {
>                 "encryptionType": "AES256"
>             }
>         },
>         {
Enter fullscreen mode Exit fullscreen mode

Summary

ECR is also automatically created in the pull-through cache, which should make it easier to create pull cache repositories from ECR public or Docker Hub.

Top comments (0)