Lifecycle policy multienv ECR
Is there a way to implement a lifecycle policy for a multi-environment ECR? I have one ECR for my application, and I upload images there from dev, stage, and prod using tag prefixes. The problem is that every time I build and upload a new image with docker buildx, only the image index has the tag, while I can see two extra images. I mean, for every build I get an index image with a tag, and two untagged images (one with 0 MB). I’m struggling to implement a lifecycle policy because my prod images are getting deleted. Sometimes it takes a long time for a new prod image to be uploaded, and the image count option is not a good idea in a multi-env ECR if I have a lot of untagged images.
Posted Mar 6, 2026, 3:53 PM UTC
01