Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

[Docker] CredsStore support #334

Closed
Closed

Description

@r2d4

I'm trying to use a private GCR registry with this library. I've set up a service account with the proper credentials as documented in the bottom of https://cloud.google.com/container-registry/docs/advanced-authentication under Using a JSON key file

It seems like getAuth will try to parse my ~/.docker/config.json file, however decodeDockerAuth will only try to parse username and password.

GCR uses the credsStore feature which shells out to https://github.com/GoogleCloudPlatform/docker-credential-gcr. My ~/.docker/config then looks like

{
	"auths": {
		"https://appengine.gcr.io": {},
		"https://asia.gcr.io": {},
		"https://b.gcr.io": {},
		"https://beta.gcr.io": {},
		"https://bucket.gcr.io": {},
		"https://eu.gcr.io": {},
		"https://gcr.io": {},
		"https://gcr.kubernetes.io": {},
		"https://us.gcr.io": {}
	},
	"credsStore": "gcr"
}

It looks like we might be able to use some of the helper functions here: https://github.com/docker/docker-ce/blob/master/components/cli/cli/config/configfile/file.go to parse the ~/.docker/config.json file and get credentials.

Let me know if I'm overlooking something obvious here. I'd definitely be up to implement the needed change, whatever it is.

Activity

  1. mtrmac commented on Aug 30, 2017

    @mtrmac
    Collaborator

    You’re not overlooking anything, this is not currently supported. An implementation of this would be very welcome.

  2. runcom commented on Sep 2, 2017

    @runcom
    Member

    Yeah, thanks for pointing this out

  3. rhatdan commented on Sep 3, 2017

    @rhatdan
    Member
  4. umohnani8 commented on Sep 5, 2017

    @umohnani8
    Member

    @rhatdan Should I work on adding this support as well to the authentication package?

  5. runcom commented on Sep 5, 2017

    @runcom
    Member

    this can be closed now though

  6. rhatdan commented on Sep 5, 2017

    @rhatdan
    Member
  7. r2d4 commented on Sep 5, 2017

    @r2d4
    Author

    Thanks for the quick resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions