auth

package
v0.1.0-alpha012 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	IndexDockerIO  = "https://index.docker.io/v1/"
	DockerRegistry = "docker.io"
)

Variables

This section is empty.

Functions

func ResolveRegistryHost

func ResolveRegistryHost(host string) string

ResolveRegistryHost can be used to transform a docker registry host name into what is used for the docker config/cred helpers

This is useful for using with containerd authorizers. Naturally this only transforms docker hub URLs.

Types

type ImageReference

type ImageReference struct {
	// Registry is the registry hostname (e.g., "docker.io", "myregistry.com:5000")
	Registry string
	// Repository is the image repository (e.g., "library/nginx", "user/image")
	Repository string
	// Tag is the image tag (e.g., "latest", "v1.0.0")
	Tag string
	// Digest is the image digest if present (e.g., "sha256:...")
	Digest string
}

ImageReference represents a parsed Docker image reference

func ParseImageRef

func ParseImageRef(imageRef string) (ImageReference, error)

ParseImageRef extracts the registry from the image name, using github.com/distribution/reference as a reference parser, and returns the ImageReference struct.

Jump to

Keyboard shortcuts

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