When using docker for mac or google cloud docker makes use of credential helpers. It doesn't appear as if this library has support for either and only supports configurations that keep the password unencrypted in the config file. Support for credential helpers would be useful for high-security environments.
{
"credsStore" : "osxkeychain",
"credHelpers" : {
"staging-k8s.gcr.io" : "gcloud",
"asia.gcr.io" : "gcloud",
"us.gcr.io" : "gcloud",
"eu.gcr.io" : "gcloud",
"gcr.io" : "gcloud"
}
}
+1, having the same problem.
FYI credHelpers support just got merged in Testcontainers project:
https://github.com/testcontainers/testcontainers-java/pull/729
We might consider moving it to docker-java in future
+1, this is preventing us from adopting this library.
@KostyaSha would you like us to contribute the credential store/helper code from Testcontainers, as mentioned by @bsideup?
This issue is also stopping the Jenkins Docker plugin from authenticating natively against GCR from GCE: https://github.com/jenkinsci/docker-plugin/issues/803
@bsideup
Any update on this? This is limiting the useage of the library for us.
You can provide your own DockerClientConfig and override effectiveAuthConfig. Credential helpers are implemented as separate binaries that you need to call. You can have a look at Testcontainers and how it is done there:
https://github.com/testcontainers/testcontainers-java/blob/ff73a5e355ce72097fd2d7f7e0bf3879f213a514/core/src/main/java/org/testcontainers/dockerclient/AuthDelegatingDockerClientConfig.java#L30
It may eventually migrate to docker-java.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Once an AuthCmd executes successfully to login, is there another call that needs to be made to add the Auth to the local Credential Store?
Most helpful comment
@KostyaSha would you like us to contribute the credential store/helper code from Testcontainers, as mentioned by @bsideup?