You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
What I have tried:
- I can successfully push to Amazon ECR (details in this answer I posted on Stack Overflow)
- I am failing to pull the above image in a subsequent pipeline (see example).
Example bitbucket-pipeline.yml
image:
name: <ecr-registry-address>/<repository>:<tag>
aws:
access-key: ${AWS_ACCESS_KEY_ID}
secret-key: ${AWS_SECRET_ACCESS_KEY}
pipelines:
default:
- step:
script:
- echo 'Hello World'
The error I get back:
Finally:
In order to push to the repository, I already setup IAM roles for the bitbucket-pipelines account (AmazonEC2ContainerRegistryPowerUser). Is there any other setup required?
Hi Dean,
If you'd like to use environment variables for your ECR image you need to change your YAML to look like this:
image:
name: <imagename>
aws:
access-key: $AWS_ACCESS_KEY_ID
secret-key: $AWS_SECRET_ACCESS_KEY
pipelines:
default:
- step:
script:
- echo 'Hello world'
...
Specifically removing the curly braces around your environment variables and realigning the whitespace (though, that may have been copy/paste).
Hope that helps! :)
Phil
Fixed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, I arrived to this conclusion just moments before you replied. Why is the case though? When you say 'fixed', is the ${} now supported?
If not, that notation is supported everywhere else in the bitbucket-pipelines.yml, so I think for consistency it would be a good idea!
I logged the following suggestion (https://jira.atlassian.com/browse/BSERV-10113), to note this limitation (if it is still present) in the documentation and to give a more descriptive error message if this is to occur.
If you have fixed the above, then the above can probably be discarded. But in general, system errors like this should be caught by a syntax validator at least.
Thanks for the support :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same problem and it's unclear to me what the resolution is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same problem, I've already removed the {} but can't get it to work.
I can push and pull with the same credentials from the local machine but not from the pipeline.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.