Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,041
Community Members
 
Community Events
168
Community Groups

Pipe 'aws-ecr-push-image' needs to clarify that you needs a 'latest'-image

Edited
I'm using
atlassian/aws-ecr-push-image:1.4.2
When building the image in some previous step, the documentation does not explicitly make it clear that it need to be tagged as "latest" (or not tagged at all).
.
I just sat here trying to get understand why my docker image was not found, when I clearly just built it. The problem was that I already had tagged the docker image.
.
I couldn't really make sense of the debug log and I though that the missing ":latest" was a problem from the AWS ECR side of things.
.
I suggest that you make it explicitly clear that the you need to build an untagged image, and that the pipe will retag it for you.

1 answer

0 votes
Caroline R Atlassian Team Sep 29, 2021

Hi, @Johan Forssell! Welcome to the community! 

We reviewed your request and, in order to properly assist you, could you please share some additional information regarding the issue you faced? Would it be possible for you to confirm to us: 

  • The image name along with the tag name that you created in the first step;

  • The value of IMAGE_NAME and TAGS that you specified in the Pipe definition to push the image;

  • The error you received.

Please, feel free to share any additional information regarding this case. Thank you.

Kind regards,
Caroline

First, I used docker build --tag to build a docker image using my whole private repo name

123456789012.dkr.ecr.eu-west-1.amazonaws.com/bla/server:latest

The I run the atlassian/aws-ecr-push-image:1.4.2 pipe

Error from the pipeline

INFO: Executing the aws-ecr-push-image pipe...
INFO: Successfully logged in to https://123456789012.dkr.ecr.eu-west-1.amazonaws.com
✖ Image not found: 404 Client Error: Not Found ("no such image: bla/server: No such image: bla/server:latest")

 I took this to indicate some kind of AWS ECR problem, which is not the case.
I was simply tagging my docker image wrong.

Config

- step:
oidc: true
name: Build and publish latest image

script:
- make docker
- pipe: atlassian/aws-ecr-push-image:1.4.2
variables:
AWS_DEFAULT_REGION: eu-west-1
AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/pipelines-ecr-access'
IMAGE_NAME: 'bla/server'
TAGS: 'latest'


Suggestion

Please add a sentence that the docker image which is the INPUT to the pipe should be called simple/name:latest.
No full repo url, no other tag than latest.

Caroline R Atlassian Team Oct 04, 2021

Hi, Johan. 

Thanks for getting back to us! Checking the README of aws-ecr-push-image, we can see the following information: 

The name of the image to push to the ECR. The name should be the same as your ECR repository name (example: my-ecr-image). Remember that you don't need to add your registry URL in front of the image name, the pipe will fetch this URL from AWS and add it for you. Don't add tag in the IMAGE_NAME variable, pass variables TAGS instead (see more information below).

So this information is described there. In this case, just to make sure we are on the same page, would you still like to add something else? 

Thank you. 

Kind regards,
Caroline

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,462 views 3 10
Read article

Atlassian Community Events