reference

package
v0.0.0-...-8feeb22 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerDefaultRegistry is the value for the registry when none was provided.
	DockerDefaultRegistry = "docker.io"
	// DockerDefaultV1Registry is the host name of the default v1 registry
	DockerDefaultV1Registry = "index." + DockerDefaultRegistry
	// DockerDefaultV2Registry is the host name of the default v2 registry
	DockerDefaultV2Registry = "registry-1." + DockerDefaultRegistry
)

Variables

This section is empty.

Functions

func IsRegistryDockerHub

func IsRegistryDockerHub(registry string) bool

IsRegistryDockerHub returns true if the given registry name belongs to Docker hub.

Types

type DockerImageReference

type DockerImageReference struct {
	Registry  string
	Namespace string
	Name      string
	Tag       string
	ID        string
}

DockerImageReference points to a Docker image.

func Parse

func Parse(spec string) (DockerImageReference, error)

Parse parses a Docker pull spec string into a DockerImageReference.

func (DockerImageReference) AsRepository

func (r DockerImageReference) AsRepository() DockerImageReference

AsRepository returns the reference without tags or IDs.

func (DockerImageReference) AsV2

func (DockerImageReference) DaemonMinimal

func (r DockerImageReference) DaemonMinimal() DockerImageReference

DaemonMinimal clears defaults that Docker assumes.

func (*DockerImageReference) DeepCopy

DeepCopy copies the receiver, creating a new DockerImageReference.

func (*DockerImageReference) DeepCopyInto

func (in *DockerImageReference) DeepCopyInto(out *DockerImageReference)

DeepCopyInto writing into out. in must be non-nil.

func (DockerImageReference) DockerClientDefaults

func (r DockerImageReference) DockerClientDefaults() DockerImageReference

DockerClientDefaults sets the default values used by the Docker client.

func (DockerImageReference) Equal

Equal returns true if the other DockerImageReference is equivalent to the reference r. The comparison applies defaults to the Docker image reference, so that e.g., "foobar" equals "docker.io/library/foobar:latest".

func (DockerImageReference) Exact

func (r DockerImageReference) Exact() string

Exact returns a string representation of the set fields on the DockerImageReference

func (DockerImageReference) Minimal

Minimal reduces a DockerImageReference to its minimalist form.

func (DockerImageReference) MostSpecific

func (r DockerImageReference) MostSpecific() DockerImageReference

MostSpecific returns the most specific image reference that can be constructed from the current ref, preferring an ID over a Tag. Allows client code dealing with both tags and IDs to get the most specific reference easily.

func (DockerImageReference) NameString

func (r DockerImageReference) NameString() string

NameString returns the name of the reference with its tag or ID.

func (DockerImageReference) RegistryHostPort

func (r DockerImageReference) RegistryHostPort(insecure bool) (string, string)

RegistryHostPort returns the registry hostname and the port. If the port is not specified in the registry hostname we default to 443. This will also default to Docker client defaults if the registry hostname is empty.

func (DockerImageReference) RegistryURL

func (r DockerImageReference) RegistryURL() *url.URL

RepositoryName returns the registry relative name

func (DockerImageReference) RepositoryName

func (r DockerImageReference) RepositoryName() string

RepositoryName returns the registry relative name

func (DockerImageReference) String

func (r DockerImageReference) String() string

String converts a DockerImageReference to a Docker pull spec (which implies a default namespace according to V1 Docker registry rules). Use Exact() if you want no defaulting.

Jump to

Keyboard shortcuts

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