docker-credential-gcr

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

README

docker-credential-gcr

Introduction

docker-credential-gcr is Google Container Registry's Docker credential helper. It allows for Docker clients v1.10+ to easily make authenticated requests to GCR's repositories (gcr.io, eu.gcr.io, etc.).

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 a explicit login operation) when running in App Engine or Compute Engine.

GCR Credentials

The helper searches for GCR credentials in the following order:

  1. In a JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable.
  2. 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.
  3. On Google App Engine it uses the appengine.AccessToken function.
  4. On Google Compute Engine and Google App Engine Managed VMs, it fetches credentials from the metadata server.
  5. From the gcloud SDK (i.e. those printed via gcloud auth print-access-token).
  6. In the helper's private credential store (i.e. those stored via docker-credential-gcr gcr-login)

Other Credentials

The helper implements the Docker Credential Store API and can be used to store credentials for other repositories. WARNING: Credentials are stored in plain text in a file under the user's home directory (e.g. $HOME/.config/gcloud/docker_credentials.json on non-windows systems).

Building from Source

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

  1. Download the source and put it in your $GOPATH with go get.

    go get github.com/GoogleCloudPlatform/docker-credential-gcr
    
  2. 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
    
  3. Put that binary in your $PATH. e.g. if /usr/bin is present on your path:

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

Installation and Usage

  • Configure the Docker CLI to use docker-credential-gcr as its credential store

    docker-credential-gcr configure-docker
    
    • Alternativley, manually set the credsStore option in your docker config (usually ~/.docker/config.json) file with the suffix of the compiled binary (everything after "docker-credential-"). e.g. for docker-credential-gcr:

      {
        "credsStore": "gcr"
      }
      
  • Log in to GCR

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

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

    docker-credential-gcr gcr-logout
    

License

Apache 2.0. See LICENSE for more information.

Documentation

Overview

Program docker-credential-gcr implements the Docker credential helper API and allows for more advanced login/authentication schemes for GCR customers.

See README.md

Directories

Path Synopsis
Package api contains the implementations of all of the subcommands that are exposed via the command line.
Package api contains the implementations of all of the subcommands that are exposed via the command line.
Package auth implements the logic required to authenticate the user and generate access tokens for use with GCR.
Package auth implements the logic required to authenticate the user and generate access tokens for use with GCR.
Package config provides constants used in configuring the behavior of the app.
Package config provides constants used in configuring the behavior of the app.
Package credhelper implements a Docker credential helper with special facilities for GCR authentication.
Package credhelper implements a Docker credential helper with special facilities for GCR authentication.
Package store impolements a credential store that is capable of storing both plain Docker credentials as well as GCR access and refresh tokens.
Package store impolements a credential store that is capable of storing both plain Docker credentials as well as GCR access and refresh tokens.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL