Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Immutable ECR repositories

There is an option in ECR to use immutable repositories which is a best practice to use. Pushing an image with an existing tag gives you an error, which is expected.

However, this is not compatible with re-running builds. There should be an option in this pipe to ignore uploading an image if the tag already exists.

The only alternative is to tag the image with a unique tag for each build.

2 answers

1 accepted

0 votes
Answer accepted

Hi @Tarek Abdel Sater ,

As we investigated:

to support immutable AWS ECR and re-running builds you could provide build with unique tags by passing TAGS parameter:


  # build the image
  - docker build -t my-docker-image .

  # use the pipe to push to AWS ECR
  - pipe: atlassian/aws-ecr-push-image:1.3.0
      IMAGE_NAME: my-docker-image
      TAGS: '${BITBUCKET_STEP_UUID}-<timestamp>'

Or setup your AWS ECR to use mutable tags, so you always have fresh version after re-running a build.

To help you, we need to understand what is your case, provide us with more details please (your pipelines configuration, main workflow, used parameters) ?


Oleksandr Kyrdan



We re-evaluated our requirements and concluded that ignoring failure to push to immutable tags is a bad practice.

The solution is, as you said, including a unique tag for each build. However, we ended up going with MUTABLE tags because we don't want to deal with noisy Docker tags.

Like Oleksandr Kyrdan likes this
0 votes

Hi @Tarek Abdel Sater

Thank you for your question!

Good suggestion, we'll investigate this feature for the aws-ecr-push-image pipe and notify you.


Oleksandr Kyrdan

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

129 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you