registry

package
v5.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace is the default namespace
	DefaultNamespace = "docker.io"
	// DefaultRegistryHost is the hostname for the default (Docker Hub) registry
	// used for pushing and pulling images. This hostname is hard-coded to handle
	// the conversion from image references without registry name (e.g. "ubuntu",
	// or "ubuntu:latest"), as well as references using the "docker.io" domain
	// name, which is used as canonical reference for images on Docker Hub, but
	// does not match the domain-name of Docker Hub's registry.
	DefaultRegistryHost = "registry-1.docker.io"
	// IndexHostname is the index hostname, used for authentication and image search.
	IndexHostname = "index.docker.io"
	// IndexServer is used for user auth and image search
	IndexServer = "https://" + IndexHostname + "/v1/"
	// IndexName is the name of the index
	IndexName = "docker.io"
)

Variables

This section is empty.

Functions

func EncodedAuth added in v5.5.1

func EncodedAuth(ref reference.Named, cfg AuthProvider) (string, error)

EncodedAuth returns the credentials for the registry hosting the given image reference, base64-encoded as expected by the Docker API's X-Registry-Auth header. The configfile normalizes the Docker Hub domain to its canonical credentials key itself.

func GetAuthConfigKey

func GetAuthConfigKey(indexName string) string

GetAuthConfigKey special-cases using the full index address of the official index as the AuthConfig key, and uses the (host)name[:port] for private indexes.

It differs from the docker CLI configfile's own normalization by also mapping the registry host (registry-1.docker.io): OCI resolvers hand the credential callback the network host actually contacted, not the reference domain.

Types

type AuthProvider added in v5.5.1

type AuthProvider interface {
	GetAuthConfig(registryHostname string) (clitypes.AuthConfig, error)
}

AuthProvider provides registry credentials for a registry hostname, as implemented by the docker CLI's configfile.

Jump to

Keyboard shortcuts

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