Version: v0.0.0-...-a5f8d25 Latest Latest

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 15 Imported by: 3



Package dockerauth handles storing auth configuration information for Docker registries.


This package pulls authentication information from the passed configuration. A user should set the "EngineAuthType" and "EngineAuthData" configuration keys to values indicated below.

These keys may be set by either setting the environment variables "ECS_ENGINE_AUTH_TYPE" and "ECS_ENGINE_AUTH_DATA" or by setting the keys "EngineAuthData" and "EngineAuthType" in the JSON configuration file located at the configured "ECS_AGENT_CONFIG_FILE_PATH" (see

Auth Types

The two currently supported auth types are "docker" and "dockercfg".


The auth type "docker" is intended to work most naturally with a JSON configuration file. The "AuthData" is a structured JSON object which specifies values for the docker "AuthConfig" structure. The "AuthData" should be an object similar to the following:

	"": {
		"username": "myUsername",
		"password": "myPassword"
	"": {
		"username": "my-dockerhub-username",
		"password": "my-dockerhub-password",
		"email": "my-optinallyincluded-email"


The auth type "dockercfg" is intended to allow easy use of an existing ".dockercfg" file generated by running "docker login". This auth type expects the "AuthData" to be a string containing the contents of that file. The contents of your ".dockercfg" will generally be a string of the following form:


Portions copyright 2012-2015 Docker, Inc. Please see LICENSE for applicable license terms and NOTICE for applicable notices.

Package dockerauth handles storing auth configuration information for Docker registries



View Source
const IndexName = ""

This is taken from Docker's codebase in whole or in part, Copyright Docker Inc.

View Source
const (
	// MinimumJitterDuration is the minimum duration to mark the credentials
	// as expired before it's actually expired
	MinimumJitterDuration = 30 * time.Minute


This section is empty.


This section is empty.


type DockerAuthProvider

type DockerAuthProvider interface {
	GetAuthconfig(image string, registryAuthData *apicontainer.RegistryAuthenticationData) (types.AuthConfig, error)

DockerAuthProvider is something that can give the auth information for a given docker image

func NewDockerAuthProvider

func NewDockerAuthProvider(authType string, authData json.RawMessage) DockerAuthProvider

func NewECRAuthProvider

func NewECRAuthProvider(ecrFactory ecr.ECRFactory, cache async.Cache) DockerAuthProvider

NewECRAuthProvider returns a DockerAuthProvider that can handle retrieve credentials for pulling from Amazon EC2 Container Registry

Jump to

Keyboard shortcuts

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