All Projects → GoogleCloudPlatform → Docker Credential Gcr

GoogleCloudPlatform / Docker Credential Gcr

Licence: apache-2.0
A Docker credential helper for GCR users

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Docker Credential Gcr

Manifest Tool
Manifest tool for manifest list object creation/query
Stars: ✭ 355 (+84.9%)
Mutual labels:  docker-registry, docker-images
docker-credential-magic
A magic shim for Docker credential helpers 🪄
Stars: ✭ 56 (-70.83%)
Mutual labels:  docker-registry, docker-images
Containerregistry
A set of Python libraries and tools for interacting with a Docker Registry.
Stars: ✭ 183 (-4.69%)
Mutual labels:  docker-registry, docker-images
dockerX
Examples of amazing Docker/Docker-Compose/Docker Swarm technologies
Stars: ✭ 17 (-91.15%)
Mutual labels:  docker-registry, docker-images
Europa
Puppet Container Registry
Stars: ✭ 114 (-40.62%)
Mutual labels:  docker-registry, docker-images
Dockernotes
Docker入门精华版
Stars: ✭ 107 (-44.27%)
Mutual labels:  docker-registry
Docker Registry Manifest Cleanup
Cleans up docker registry by removing untagged manifests from the registry
Stars: ✭ 127 (-33.85%)
Mutual labels:  docker-registry
Reg
Docker registry v2 command line client and repo listing generator with security checks.
Stars: ✭ 1,485 (+673.44%)
Mutual labels:  docker-registry
Sas Container Recipes
A collection of recipes and other resources for building containers that include SAS Viya software.
Stars: ✭ 71 (-63.02%)
Mutual labels:  docker-registry
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+1146.35%)
Mutual labels:  docker-images
Deckschrubber
Deckschrubber inspects images of a Docker Registry and removes those older than a given age. 🔆🚢
Stars: ✭ 176 (-8.33%)
Mutual labels:  docker-registry
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+5821.88%)
Mutual labels:  docker-registry
Terraform Aws Ecr
Terraform Module to manage Docker Container Registries on AWS ECR
Stars: ✭ 110 (-42.71%)
Mutual labels:  docker-registry
Mq Container
Container images for IBM® MQ
Stars: ✭ 138 (-28.12%)
Mutual labels:  docker-images
Bitnami Docker Suitecrm
SuiteCRM container image
Stars: ✭ 105 (-45.31%)
Mutual labels:  docker-images
Nodedock
📦🚢 Docker Node.js development environment
Stars: ✭ 180 (-6.25%)
Mutual labels:  docker-images
Imagewolf
Fast Distribution of Docker Images on Clusters
Stars: ✭ 94 (-51.04%)
Mutual labels:  docker-registry
Dockstation
DockStation is developer-centric application to managing projects based on Docker. Instead of lots of CLI commands you can monitor, configure, and manage services and containers using just a GUI.
Stars: ✭ 1,744 (+808.33%)
Mutual labels:  docker-images
Login Action
GitHub Action to login against a Docker registry
Stars: ✭ 149 (-22.4%)
Mutual labels:  docker-registry
Owasp Workshop
owasp-workshop: Orchetraing containers with Kubernetes
Stars: ✭ 116 (-39.58%)
Mutual labels:  docker-registry

docker-credential-gcr Build Status Go Report Card

Introduction

docker-credential-gcr is Google 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.).

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. For normal development setups, users are encouraged to use gcloud auth configure-docker, instead.

The helper implements the Docker Credential Store API, but enables more advanced authentication schemes for GCR's users. In particular, it respects Application Default Credentials and is capable of generating credentials automatically (without an explicit login operation) when running in App Engine or Compute Engine.

For even more authentication options, see GCR's documentation on advanced authentication methods.

GCR Credentials

By default, the helper searches for GCR credentials in the following order:

  1. In the helper's private credential store (i.e. those stored via docker-credential-gcr gcr-login)
  2. In a JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable.
  3. In a JSON file in a location known to the helper:
    • On Windows, this is %APPDATA%/gcloud/application_default_credentials.json.
    • On other systems, $HOME/.config/gcloud/application_default_credentials.json.
  4. On Google App Engine, it uses the appengine.AccessToken function.
  5. 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).

Users 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".

While it is recommended to use gcloud 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).

Examples:

To use only the gcloud SDK's access token:

docker-credential-gcr config --token-source="gcloud"

To search the environment, followed by the private store:

docker-credential-gcr config --token-source="env, store"

To verify that credentials are being returned for a given registry, e.g. for https://gcr.io:

echo "https://gcr.io" | docker-credential-gcr get

Other Credentials

As of the 2.0 release, docker-credential-gcr no longer supports generalized credsStore functionality.

Building from Source

The program in this repository is written with the Go programming language and built with make. These instructions assume that Go 1.11+ and make are installed on a *nix system.

You can download the source code, compile the binary, and put it in your $GOPATH with go get.

go get -u github.com/GoogleCloudPlatform/docker-credential-gcr

If $GOPATH/bin is in your system $PATH, this will also automatically install the compiled binary. You can confirm using which docker-credential-gcr and continue to the section on Configuration and Usage.

Alternatively, you can use make to build the program. The executable will be output to the bin directory inside the repository.

cd $GOPATH/src/github.com/GoogleCloudPlatform/docker-credential-gcr
make

Then, you can put that binary in your $PATH to make it visible to docker. For example, if /usr/bin is present in your system path:

sudo mv ./bin/docker-credential-gcr /usr/bin/docker-credential-gcr

Configuration and Usage

  • Configure the Docker CLI to use docker-credential-gcr as a credential helper for the default set of GCR registries:

     docker-credential-gcr configure-docker
    

    To speed up docker builds, you can instead configure a minimal set of registries:

    docker-credential-gcr configure-docker --registries="eu.gcr.io, marketplace.gcr.io"
    
  • Log in to GCR (or don't! See the GCR Credentials section)

     docker-credential-gcr gcr-login
    
  • Use Docker!

     docker pull gcr.io/project-id/neato-container
    
  • Log out from GCR

     docker-credential-gcr gcr-logout
    

Manual Docker Client Configuration

Add 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-").

e.g. for `docker-credential-gcr`:
    {
      "auths" : {
            ...
      },
      "credHelpers": {
            "coolregistry.com": ... ,
            "gcr.io": "gcr",
            "asia.gcr.io": "gcr",
            ...
      },
      "HttpHeaders": ...
      "psFormat": ...
      "imagesFormat": ...
      "detachKeys": ...
    }
  

License

Apache 2.0. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].