latest tag multiple times without pushing a new image, what will happen?Docker clients cache images locally after the first pull. Pulling the same tag again uses the cached image unless you explicitly force a refresh. This behavior reduces data transfer and speeds up deployments.
Pushing images requires ecr:PutImage permission, while pulling requires read permissions like ecr:BatchCheckLayerAvailability and ecr:GetDownloadUrlForLayer. Restricting PutImage to one user and allowing read actions to others enforces the desired access control.
ECR supports cross-region replication by enabling it on the source repository and specifying destination repositories. A replication IAM role with permissions in both regions is required to allow ECR to replicate images automatically.
Using immutable tags with version numbers or commit hashes prevents accidental overwrites and allows you to roll back to previous versions easily. Overwriting latest can cause confusion and deployment issues.
dev older than 7 days. After 40 days, which images will be deleted?ECR lifecycle policies apply rules independently. Untagged images older than 30 days and images tagged dev older than 7 days both match their respective rules and will be deleted after 40 days.