-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for mapping a registry to a specific AWS_PROFILE #249
Comments
This might also solve #247, I'll let @johnkeates weigh in if he wants to fold his ask into this issue |
@micahhausler This would indeed be the same issue. I was under the impression that AWS_PROFILE was only used/read if we also specifically set AWS_SDK_LOAD_CONFIG to true, so we'd still need both environment variables, right? |
|
|
Odd, I couldn't get it to work without that. Perhaps I was using an old release. |
There hasn't been a release with this fix yet, it happened after 0.4.0, which is the most recent release. It'll be in the next release. |
Ah yes, that makes sense. I was confusing a merge with a direct release afterwards ;-) |
@TBBle @johnkeates Version 0.5.0 now loads the shared config by default so you no longer need to set |
We use this credential helper to publish resources across organizational boundaries which have unique IAM credentials (for reasons). Being able to associate a given registry with a specific AWS profile would address some real pain points. In particular, manipulating images into the usgov partition is really hard right now since we cannot associate an AWS profile with a given registry. |
Why is this labeled In our case we have our users |
any updates on this one? |
Also, how can one set the priority or specify that regardless of having If I set any of those, and trigger any further docker commands, |
@fagiani That might be better as a separate feature request ticket, it's not really related to this one. I suspect it's also something that will be driven by the underlying SDK, not |
@TBBle that makes sense. I'll investigate the issue further and if required open an issue on the SDK project. Sorry for the noise here. Keep Rocking! |
we are trying to achieve pulling our images from an ECR repository located on the aws partition from an EKS cluster located on the aws-gov partition. due to how the integration between eks and ECR works, we resolved to using the creds helper to provide the node dynamic credentials for the non-gov account.
binding a registry to an aws profile will solve all of these rather cleanly and will allow us to avoid doing blasphemous stuff like injecting a cronjob into the node to use awscli to login into the registry all the time... this requirement is a real pain point and will honestly be a great solve if we can get it..... |
As a workaround, I've been adding bash scripts in my $PATH that look like this: #!/bin/bash
AWS_PROFILE=my-cool-profile docker-credential-ecr-login "$@" That will be saved as |
Have there been any further internal discussion on this? We're still using hacks to get around this, but it's particularly bothersome when you have to distribute the hack to an entire org. |
I've raised a PR and given it a go. My changes work well for me (testing locally) but will continue to use over the next week or so. PR is #894 and feedback would be appreciated. |
In the EKS Distro, we use ecr-credential-helper with buildkit to pull base images and push images, but we often have base images in one account, and need to push images to a separate account. Rather than using ECR repository policies to grant a single IAM role permission to do a in-account pull and a cross-account push, we use have a separate role our build job can assume to push cross-account to ECR public. I know ECR Public is already requested (#248), but simply adding support won't solve our use case.
ECR public doesn't (yet?) support repository policies, and we want our builder process to use a separate IAM role for ECR private pulls than the one used to push to ECR public.
Our current docker config looks like the following:
because using
{"credsStore": "ecr-login"}
swallows any token you try to save to the config file.Right now, we have a gross hack that saves the ecr public credential in the docker config.
This allows buildkit to pull from one account and push from another in the same command.
I'd be great to have a config file that could associate registries with specific AWS profiles. For example, if my
~/.aws/config
looked like thisI would want a way to associate
111122223333.dkr.ecr.us-west-2.amazonaws.com
withAWS_PROFILE=default
andpublic.ecr.aws
withAWS_PROFILE=publish
.This is not a formal proposal for a config spec, but it could be something like:
which would allow me to just set my Docker config to
{"credsStore": "ecr-login"}
not think about itThe text was updated successfully, but these errors were encountered: