Pipe 'aws-ecr-push-image' needs to clarify that you needs a 'latest'-image
Asked by Johan Forssell:

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.**


Answers:
author: Caroline R
body: Hi, [@Johan Forssell](/t5/user/viewprofilepage/user-id/4554532)! 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

comments: author: Johan Forssell
body: 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 {#toc-hId--1214178699}
----------------------------------------------

> 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 {#toc-hId-1273334134}
----------------------------

```
- 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 {#toc-hId--534120329}
--------------------------------

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.


author: Caroline R
body: Hi, Johan.

Thanks for getting back to us! Checking the README of [aws-ecr-push-image](https://bitbucket.org/atlassian/aws-ecr-push-image/src/master/), 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


Tags: aws

bitbucket-pipelines

cloud

documentation