0

I am creating a CI/CD Pipeline for my project. I am building the Images using GitHub Actions and storing them in the AWS ECR.

The whole pipeline works fine but there is a problem with updating the image tags, and whenever I run the pipeline the subsequent runs fail saying the Image Tag already exists in the registry.

I tried multiple times but had no luck.

I tried to fetch the tags from the remote, but it shows the previous version as below enter image description here

When there is already a new Image tag exists in the registry enter image description here

It seems like, the latest tag is not getting updated.

I am using a bash script to read and update the tag while building the image.

Can someone please explain how I can update the tags automatically?

1
  • You have to show the relevant parts of the pipeline. Commented Mar 7, 2023 at 15:09

1 Answer 1

1

whenever I run the pipeline the subsequent runs fail saying the Image Tag already exists in the registry.

Change ECR repo settings to MUTABLE to override image tag.

Reference: https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html

You can configure a repository to turn on tag immutability to prevent image tags from being overwritten. After the repository is configured for immutable tags, an ImageTagAlreadyExistsException error is returned if you attempt to push an image with a tag that is already in the repository.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.