Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

ECR Docker image in Pipe.yml

In their example
https://support.atlassian.com/bitbucket-cloud/docs/write-a-pipe-for-bitbucket-pipelines/

It shows a public pipe used in the pipe.yml file.

Our docker images are stored in our AWS ECR. What is the syntax for referencing the ECR image in the pipe.yml (access keys etc). 

In a previous support ticket to use ecr they mentioned to use this

pipelines:  
default:
- step:
script:
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email)
- pipe: docker://ecrurl
variables:
MY_VARIABLE: 'foo'
MY_OTHER_VARIABLE: 'bar'

 below. I'm wondering if this would work in the context of pipe.yml also. 

2 answers

In my case, i resolved the issue using this code (Having configurated the AWS credentials in the pipeline variables) :

 

 step:
name: Test pipe
script:
# AWS Credential
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY
- export AWS_DEFAULT_REGION=$AWS_REGION
- $(aws ecr get-login --no-include-email)
- pipe: docker://<ecr_url>

Not ideal unless you want to be manually refreshing access keys every 90 days.

I'd rather use OIDC.

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 25, 2021

@Ming Han Chung it depends what exactly you want to do on ecr? If you want to push to ecr repository, we recommend to check out ecr deploy pipe: https://bitbucket.org/atlassian/aws-ecr-push-image

Describe what you would like to do with ecr and we can think on how to help you.

Regards, Galyna

Could you show an example of how to push an image to public ECR repository ? Is there any additional attributes which needs to be added along with the ones shown in the example ?

 

I am getting the following error

 

"The repository with name 'xxxxxxxx' does not exist in the registry with id 'xxxxxxxxx'"

 

P.S:  I do have a repository under public category in the AWS account, but not sure why it's unable to recognise that 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events