Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

Bitbucket pipeline failed when login to docker

Hi My bitbucket pipeline fails when i try to push docker image to ECR through bitbucket pipeline 


step: &f-ecr-release
        name: 'Frontend image ECR'
        image: tstrohmeier/awscli:3.8.3
          - docker
          - pip
          # aws login
          - aws configure set default.region us-east-1
          #- aws configure set aws_access_key_id $AWS_KEY
          #- aws configure set aws_secret_access_key $AWS_SECRET
          - aws configure set aws_access_key_id "${AWS_ACCESS_KEY}"
          - aws configure set aws_secret_access_key "${AWS_SECRET_ACCESS_KEY}"
          - eval $(aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin *********.dkr.ecr.$ | sed 's;https://;;g')
          # docker
          - cd frontend
          - cp .env.e2e /.env
          - echo $BUILD_ID
          - docker build -t nspire-frontend .
          - docker tag nspire-frontend:latest *******
          - docker push *******
Error was 
+ eval $(aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin 199428173682.dkr.ecr.$ | sed 's;https://;;g')
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See

bash: Login: command not found
if I takeout docker login part it fails when push and says 
no basic auth credentials

1 answer

2 votes
Patrik S Atlassian Team May 10, 2022

Hello @Jameesh Moidunny ,

Welcome to Atlassian Community!

The issue here seems to be that the aws cli command get-login-password directly output the password to be used in the docker login, so you don't have to use the command within an eval$(). You can just pipe the output of the command to docker login, as below :

aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<region>


You would just need the eval$() command if you were using get-login, which is previous version of the aws cli command to get the credentials. The get-login function would return a docker login string containing the token, and this is the reason it would need to be used along with eval$()


Another option I would like to share is that you can use the pipe atlassian/aws-ecr-push-image to push the image you are building to your ECR registry. Please find below an example YML file using that pipe :

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

  # use the pipe to push the image to AWS ECR
  - pipe: atlassian/aws-ecr-push-image:1.5.0
      IMAGE_NAME: my-docker-image

You can refer to the following documentation for more details about atlassian/aws-ecr-push-image pipe and how it can be configured :

Hope that helps! Let me know in case you have any further questions related to this topic.

Thank you @Jameesh Moidunny ,

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events