Docker-java: Support for credsStore and credHelpers in config.json

Created on 4 Jun 2018  路  9Comments  路  Source: docker-java/docker-java

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"
  }
}
resolutiostale

Most helpful comment

@KostyaSha would you like us to contribute the credential store/helper code from Testcontainers, as mentioned by @bsideup?

All 9 comments

+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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yannic92 picture Yannic92  路  5Comments

kpnarayanan picture kpnarayanan  路  4Comments

ybouhjira picture ybouhjira  路  7Comments

coder-hugo picture coder-hugo  路  6Comments

richard-yao picture richard-yao  路  6Comments