Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultRuntime is the runtime to use when not specified. DefaultRuntime = "runc" // NameTotalLengthMax is the maximum total number of characters in a // repository name. NameTotalLengthMax = 255 // DefaultTag defines the default tag used when performing images related // actions and no tag or digest is specified. DefaultTag = "latest" // DefaultHostname is the default built-in hostname DefaultHostname = "docker.io" // LegacyDefaultHostname is automatically converted to DefaultHostname LegacyDefaultHostname = "index.docker.io" // DefaultRepoPrefix is the prefix used for default repositories in default // host. DefaultRepoPrefix = "library/" )
Variables ¶
View Source
var ( // ErrReferenceInvalidFormat represents an error while trying to parse a // string as a reference. ErrReferenceInvalidFormat = errors.New("invalid reference format") // ErrTagInvalidFormat represents an error while trying to parse a string as a // tag. ErrTagInvalidFormat = errors.New("invalid tag format") // ErrDigestInvalidFormat represents an error while trying to parse a string // as a tag. ErrDigestInvalidFormat = errors.New("invalid digest format") // ErrNameEmpty is returned for empty, invalid repository names. ErrNameEmpty = errors.New("repository name must have at least one component") // ErrNameTooLong is returned when a repository name is longer than // NameTotalLengthMax. ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax) )
View Source
var ( // TagRegexp matches valid tag names. From docker/docker:graph/tags.go. TagRegexp = match(`[\w][\w.-]{0,127}`) // DigestRegexp matches valid digests. DigestRegexp = match(`[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}`) // RuntimeRegexp RuntimeRexp = expression( optional(capture(alphaRegexp), literal(`://`))) // NameRegexp is the format for the name component of references. The // regexp has capturing groups for the hostname and name part omitting // the separating forward slash from either. NameRegexp = expression( optional(hostnameRegexp, literal(`/`)), nameComponentRegexp, optional(repeated(literal(`/`), nameComponentRegexp))) // ReferenceRegexp is the full supported format of a reference. The regexp // is anchored and has capturing groups for name, tag, and digest // components. ReferenceRegexp = anchored(capture(RuntimeRexp), capture(NameRegexp), optional(literal(":"), capture(TagRegexp)), optional(literal("@"), capture(DigestRegexp))) )
Functions ¶
Types ¶
type Bridge ¶
type Bridge struct { Name string Interface string Subnet string CacheDir string // contains filtered or unexported fields }
type Image ¶
type Image struct { // Runtime is the normalized name of the runtime service, e.g. "docker" Runtime string // Name is the normalized repository name, like "ubuntu". Name string // String is the full reference, like "ubuntu@sha256:abcdef..." String string // FullName is the full repository name with hostname, like "docker.io/library/ubuntu" FullName string // Hostname is the hostname for the reference, like "docker.io" Hostname string // RemoteName is the the repository component of the full name, like "library/ubuntu" RemoteName string // Tag is the tag of the image, e.g. "latest" Tag string }
Image is an object with a full name
Click to show internal directories.
Click to hide internal directories.