Documentation ¶
Index ¶
- Constants
- func IsRegistryDockerHub(registry string) bool
- type DockerImageReference
- func (r DockerImageReference) AsRepository() DockerImageReference
- func (r DockerImageReference) AsV2() DockerImageReference
- func (r DockerImageReference) DaemonMinimal() DockerImageReference
- func (in *DockerImageReference) DeepCopy() *DockerImageReference
- func (in *DockerImageReference) DeepCopyInto(out *DockerImageReference)
- func (r DockerImageReference) DockerClientDefaults() DockerImageReference
- func (r DockerImageReference) Equal(other DockerImageReference) bool
- func (r DockerImageReference) Exact() string
- func (r DockerImageReference) Minimal() DockerImageReference
- func (r DockerImageReference) MostSpecific() DockerImageReference
- func (r DockerImageReference) NameString() string
- func (r DockerImageReference) RegistryHostPort(insecure bool) (string, string)
- func (r DockerImageReference) RegistryURL() *url.URL
- func (r DockerImageReference) RepositoryName() string
- func (r DockerImageReference) String() string
Constants ¶
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 ¶
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 (r DockerImageReference) AsV2() DockerImageReference
func (DockerImageReference) DaemonMinimal ¶
func (r DockerImageReference) DaemonMinimal() DockerImageReference
DaemonMinimal clears defaults that Docker assumes.
func (*DockerImageReference) DeepCopy ¶
func (in *DockerImageReference) DeepCopy() *DockerImageReference
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 ¶
func (r DockerImageReference) Equal(other DockerImageReference) bool
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 ¶
func (r DockerImageReference) Minimal() DockerImageReference
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.