-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add support for Docker's credential stores and helpers #44633
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
Comments
Thanks for raising this. The title suggests that authenticating with a builder registry doesn't work at all. As far as we know, that's not the case. Your description reads like the problem only occurs when using a credential helper. Does that match what you're experiencing? |
Hello @wilkinsona, sorry about the confusion. I also tried with
I don't know if the different error is due to a difference in docker login vs credential helper or because I'm using a different registry here (dockerhub, as I don't have an account where I can docker login on ecr), but the end result is the same. |
If you have pulled the image beforehand, you could workaround by setting the I guess the existing authentication options are no help because you don't have a username / password / token? |
Even with a valid username / password they are not used for pulling the builder, as mentioned in the docs they are only used for publishing. I tried anyway and it doesn't work.
This is a valid workaround, although it introduces fragilities into the build and doesn't guarantee the builder is fresh, which has security concerns. |
I can't find the section where it mentions that the credentials are not used when pulling the builder.
I haven't read the code, but this reads like authenticating when pulling builder images is possible. Did you try
? |
Apologies, I was misremembering the documentation and only taking into consideration @wilkinsona you were correct, the issue only sussists when using a credential helper. |
We'd have to implement support for Docker's credentials store / helpers. Documentation for that is here: https://docs.docker.com/reference/cli/docker/login/#credential-stores |
A few notes from experimenting with this. The user's Docker config identifies a store: {
"auths": {},
"credsStore": "desktop",
"currentContext": "desktop-linux",
"plugins": {
"-x-cli-hints": {
"enabled": "true"
}
},
"features": {
"hooks": "true"
}
} In the above, the store is named The
The
AIUI, the |
I have several questions regarding this issue:
|
I've implemented default Docker authentication in my branch, leveraging credential helpers, the credential store, and static credentials. I have not updated the documentation yet as I wanted to get some feedback on whether it's worth proceeding further. Implementation details were taken from the official Docker CLI. By default, if users do not provide credentials, instead of using empty authentication (which was the previous behavior), a new This change should resolve this issue, and additionally #25898 and #24547 |
@nosan Are you able to submit a PR from your branch? I'd like to see if we can try to squeeze something for this into 3.5 |
For reference, the following Testcontainers code might also help: |
Running
spring-boot:build-image
fails when the builder configured in thespring-boot-maven-plugin
is not in a public repository, with message:Docker is configured with a credential helper (ecr-login + aws sso login for me) so docker pull/push work fine, but I suspect that direct API calls to the socket don't interact with the credential helper. Using docker login also doesn't work, nor does pulling the image beforehand.
pack build
works fine, but I'd rather use a maven plugin than coordinate the build between maven and an external tool.I need a different builder because of #43716.
Possibly related to #25898.
Steps to reproduce:
credHelpers
section of.docker/config.json
)mvn spring-boot:build-image
The text was updated successfully, but these errors were encountered: