{"id":15221526,"url":"https://github.com/googlecloudplatform/docker-credential-gcr","last_synced_at":"2025-05-14T04:07:32.252Z","repository":{"id":38539926,"uuid":"64682937","full_name":"GoogleCloudPlatform/docker-credential-gcr","owner":"GoogleCloudPlatform","description":"A Docker credential helper for GCR users","archived":false,"fork":false,"pushed_at":"2025-05-08T21:59:34.000Z","size":1266,"stargazers_count":299,"open_issues_count":29,"forks_count":92,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-05-08T22:34:57.598Z","etag":null,"topics":["compute-engine","docker","docker-client","docker-image-registry","docker-images","docker-registry","gcloud","gcloud-sdk"],"latest_commit_sha":null,"homepage":"https://gcr.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleCloudPlatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-01T16:22:21.000Z","updated_at":"2025-05-08T21:59:10.000Z","dependencies_parsed_at":"2023-02-18T11:48:47.838Z","dependency_job_id":"0db10f55-8fab-434a-a701-bad4ed174226","html_url":"https://github.com/GoogleCloudPlatform/docker-credential-gcr","commit_stats":{"total_commits":208,"total_committers":31,"mean_commits":6.709677419354839,"dds":0.5288461538461539,"last_synced_commit":"68f0b56d5d84fd3bdf7c20f303f97e4297c3fbb9"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fdocker-credential-gcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fdocker-credential-gcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fdocker-credential-gcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fdocker-credential-gcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleCloudPlatform","download_url":"https://codeload.github.com/GoogleCloudPlatform/docker-credential-gcr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069507,"owners_count":22009558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compute-engine","docker","docker-client","docker-image-registry","docker-images","docker-registry","gcloud","gcloud-sdk"],"created_at":"2024-09-28T15:05:35.896Z","updated_at":"2025-05-14T04:07:32.220Z","avatar_url":"https://github.com/GoogleCloudPlatform.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://gcr.io\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/21046548?s=400\u0026v=4\" height=\"120\"/\u003e\u003c/a\u003e\n\n# docker-credential-gcr [![Build Status](https://github.com/GoogleCloudPlatform/docker-credential-gcr/actions/workflows/test.yml/badge.svg)](https://travis-ci.org/GoogleCloudPlatform/docker-credential-gcr) [![Go Report Card](https://goreportcard.com/badge/GoogleCloudPlatform/docker-credential-gcr)](https://goreportcard.com/report/GoogleCloudPlatform/docker-credential-gcr)\n\n## Introduction\n\n`docker-credential-gcr` is [Google Container Registry](https://cloud.google.com/container-registry/)'s _standalone_, `gcloud` SDK-independent Docker credential helper. It allows for **v18.03+ Docker clients** to easily make authenticated requests to GCR's repositories (gcr.io, eu.gcr.io, etc.).\n\n**Note:** `docker-credential-gcr` is primarily intended for users wishing to authenticate with GCR in the **absence of `gcloud`**, though they are [not mutually exclusive](#gcr-credentials). For normal development setups, users are encouraged to use [`gcloud auth configure-docker`](https://cloud.google.com/sdk/gcloud/reference/auth/configure-docker), instead.\n\nThe helper implements the [Docker Credential Store](https://docs.docker.com/engine/reference/commandline/login/#/credentials-store) API, but enables more advanced authentication schemes for GCR's users. In particular, it respects [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) and is capable of generating credentials automatically (without an explicit login operation) when running in App Engine or Compute Engine.\n\nFor even more authentication options, see GCR's documentation on [advanced authentication methods](https://cloud.google.com/container-registry/docs/advanced-authentication).\n\n## Installation\n\nDownload [latest release](https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/latest).\n\nInstall manually:\n\n```\ngo install github.com/GoogleCloudPlatform/docker-credential-gcr/v2@latest\n```\n\n## Configuration and Usage\n\n* Configure the Docker CLI to use `docker-credential-gcr` as a credential helper for the default set of GCR registries:\n\n\t```shell\n\tdocker-credential-gcr configure-docker\n\t```\n\n  To speed up `docker build`s, you can instead configure a minimal set of registries:\n\n  ```shell\n  docker-credential-gcr configure-docker --registries=\"gcr.io,us-west1-docker.pkg.dev,docker.europe-west3.rep.pkg.dev\"\n  ```\n\n  * Alternatively, use the [manual configuration instructions](#manual-docker-client-configuration) below to configure your version of the Docker client.\n\n* Log in to GCR (or don't! See the [GCR Credentials section](#gcr-credentials))\n\n\t```shell\n\tdocker-credential-gcr gcr-login\n\t```\n\n* Use Docker!\n\n\t```shell\n\tdocker pull gcr.io/project-id/neato-container\n\t```\n\n* Log out from GCR\n\n\t```shell\n\tdocker-credential-gcr gcr-logout\n\t```\n\n## GCR Credentials\n\n_By default_, the helper searches for GCR credentials in the following order:\n\n1. In the helper's private credential store (i.e. those stored via `docker-credential-gcr gcr-login`)\n1. In a JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable.\n1. In a JSON file in a location known to the helper:\n\t* On Windows, this is `%APPDATA%/gcloud/application_default_credentials.json`.\n\t* On other systems, `$HOME/.config/gcloud/application_default_credentials.json`.\n1. On Google App Engine, it uses the `appengine.AccessToken` function.\n1. On Google Compute Engine, Kubernetes Engine, and App Engine Managed VMs, it fetches the credentials of the _service account_ associated with the VM from the metadata server (if available).\n\nUsers may limit, re-order how the helper searches for GCR credentials using `docker-credential-gcr config --token-source`. Number 1 above is designated by `store` and 2-5 by `env` (which cannot be individually restricted or re-ordered). Multiple sources are separated by commas, and the default is `\"store,  env\"`.\n\nWhile it is recommended to use [`gcloud auth configure-docker`](https://cloud.google.com/sdk/gcloud/reference/auth/configure-docker) in `gcloud`-based work flows, you may optionally configure `docker-credential-gcr` to use `gcloud` as a token source (see example below).\n\n**Examples:**\n\nTo use _only_ the gcloud SDK's access token:\n```shell\ndocker-credential-gcr config --token-source=\"gcloud\"\n```\n\nTo search the environment, followed by the private store:\n```shell\ndocker-credential-gcr config --token-source=\"env, store\"\n```\n\nTo verify that credentials are being returned for a given registry, e.g. for `https://gcr.io`:\n\n```shell\necho \"https://gcr.io\" | docker-credential-gcr get\n```\n\n## Other Credentials\n\nAs of the 2.0 release, `docker-credential-gcr` no longer supports generalized [`credsStore`](https://docs.docker.com/engine/reference/commandline/login/#/credentials-store) functionality.\n\n### Manual Docker Client Configuration\n\nAdd a `credHelpers` entry in the Docker config file (usually `~/.docker/config.json` on OSX and Linux, `%USERPROFILE%\\.docker\\config.json` on Windows) for each GCR registry that you care about. The key should be the domain of the registry (**without** the \"https://\") and the value should be the suffix of the credential helper binary (everything after \"docker-credential-\").\n\n\te.g. for `docker-credential-gcr`:\n\n  \u003cpre\u003e\n    {\n      \"auths\" : {\n            ...\n      },\n      \"credHelpers\": {\n            \"coolregistry.com\": ... ,\n            \u003cb\u003e\"gcr.io\": \"gcr\",\n            \"asia.gcr.io\": \"gcr\",\n            ...\u003c/b\u003e\n      },\n      \"HttpHeaders\": ...\n      \"psFormat\": ...\n      \"imagesFormat\": ...\n      \"detachKeys\": ...\n    }\n  \u003c/pre\u003e\n\n## License\n\nApache 2.0. See [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fdocker-credential-gcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglecloudplatform%2Fdocker-credential-gcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fdocker-credential-gcr/lists"}