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
Set environment variables for credHelper #2814
Comments
This is an interesting use case. As another coarse workaround, you can write two wrapper scripts #!/bin/sh
AWS_PROFILE=profile-foo
exec docker-credential-ecr-login $* # "exec" is not really required; I just do it to replace the sh process. Then having |
@chanseokoh Thanks for the idea - I ended up being able to push the base image into the same ecr registry as the output image. So problem solved for me, but by working around it. But I think this is a valid, if not that common, use case, so I would like to leave this as a feature request. |
@chanseokoh I would like to help in this. I have researched a bit and found that, we can get credentials specific to AWS_PROFILE by setting AWS_PROFILE=profile-foo, before calling start in Line 134 in 9f4c93c
something like
But I have few questions
|
@vinod-tahelyani thanks for your interest on this. What we want is a general way to provide any environment variables when running a credential helper. Maybe something like
while still maintaining backward compatibility with the current usage: |
@chanseokoh I have linked a PR, which is solution for gradle. Pls look into, if it looks ok then I'll add solution for maven and corresponding test as well. |
Haven't heard back from @vinod-tahelyani about their PR (#3093) for months. Will close the PR due to inactivity. This issue is again up for a "good first issue", welcoming contributions. |
Hey @chanseokoh I'm happy to pick this up. Will get a PR out soon! |
@chanseokoh I've raised #3575 to fix this - please have a look when you can. Thanks! |
jib-maven-plugin v3.2.1 and jib-gradle-plugin v3.2.1 released. |
I want to use the "ecr-login" credHelper for both
from
andto
, but I need to use different environment variables (AWS_PROFILE
in my case), because the IAM is different in each case. If it is possible somehow, I would like to know, and if not, I would like to request this feature (just like e.g.environment
can be set fordockerClient
).As a workaround, I will now try to run the credHelper manually and pass in username/password values via system properties (
-Djib.to.auth.username=...
)The text was updated successfully, but these errors were encountered: