manifest

package
v5.4.4-testing.rhel8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 19 Imported by: 186

Documentation

Index

Constants

View Source
const (
	// DockerV2Schema1MediaType MIME type represents Docker manifest schema 1
	DockerV2Schema1MediaType = "application/vnd.docker.distribution.manifest.v1+json"
	// DockerV2Schema1MediaType MIME type represents Docker manifest schema 1 with a JWS signature
	DockerV2Schema1SignedMediaType = "application/vnd.docker.distribution.manifest.v1+prettyjws"
	// DockerV2Schema2MediaType MIME type represents Docker manifest schema 2
	DockerV2Schema2MediaType = "application/vnd.docker.distribution.manifest.v2+json"
	// DockerV2Schema2ConfigMediaType is the MIME type used for schema 2 config blobs.
	DockerV2Schema2ConfigMediaType = "application/vnd.docker.container.image.v1+json"
	// DockerV2Schema2LayerMediaType is the MIME type used for schema 2 layers.
	DockerV2Schema2LayerMediaType = "application/vnd.docker.image.rootfs.diff.tar.gzip"
	// DockerV2SchemaLayerMediaTypeUncompressed is the mediaType used for uncompressed layers.
	DockerV2SchemaLayerMediaTypeUncompressed = "application/vnd.docker.image.rootfs.diff.tar"
	// DockerV2ListMediaType MIME type represents Docker manifest schema 2 list
	DockerV2ListMediaType = "application/vnd.docker.distribution.manifest.list.v2+json"
	// DockerV2Schema2ForeignLayerMediaType is the MIME type used for schema 2 foreign layers.
	DockerV2Schema2ForeignLayerMediaType = "application/vnd.docker.image.rootfs.foreign.diff.tar"
	// DockerV2Schema2ForeignLayerMediaType is the MIME type used for gzippped schema 2 foreign layers.
	DockerV2Schema2ForeignLayerMediaTypeGzip = "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip"
)

FIXME(runcom, mitr): should we have a mediatype pkg??

Variables

DefaultRequestedManifestMIMETypes is a list of MIME types a types.ImageSource should request from the backend unless directed otherwise.

View Source
var (
	// SupportedListMIMETypes is a list of the manifest list types that we know how to
	// read/manipulate/write.
	SupportedListMIMETypes = []string{
		DockerV2ListMediaType,
		imgspecv1.MediaTypeImageIndex,
	}
)

Functions

func AddDummyV2S1Signature

func AddDummyV2S1Signature(manifest []byte) ([]byte, error)

AddDummyV2S1Signature adds an JWS signature with a temporary key (i.e. useless) to a v2s1 manifest. This is useful to make the manifest acceptable to a Docker Registry (even though nothing needs or wants the JWS signature).

func BlobInfoFromOCI1Descriptor

func BlobInfoFromOCI1Descriptor(desc imgspecv1.Descriptor) types.BlobInfo

BlobInfoFromOCI1Descriptor returns a types.BlobInfo based on the input OCI1 descriptor.

func BlobInfoFromSchema2Descriptor

func BlobInfoFromSchema2Descriptor(desc Schema2Descriptor) types.BlobInfo

BlobInfoFromSchema2Descriptor returns a types.BlobInfo based on the input schema 2 descriptor.

func Digest

func Digest(manifest []byte) (digest.Digest, error)

Digest returns the a digest of a docker manifest, with any necessary implied transformations like stripping v1s1 signatures.

func GuessMIMEType

func GuessMIMEType(manifest []byte) string

GuessMIMEType guesses MIME type of a manifest and returns it _if it is recognized_, or "" if unknown or unrecognized. FIXME? We should, in general, prefer out-of-band MIME type instead of blindly parsing the manifest, but we may not have such metadata available (e.g. when the manifest is a local file).

func MIMETypeIsMultiImage

func MIMETypeIsMultiImage(mimeType string) bool

MIMETypeIsMultiImage returns true if mimeType is a list of images

func MIMETypeSupportsEncryption added in v5.1.0

func MIMETypeSupportsEncryption(mimeType string) bool

MIMETypeSupportsEncryption returns true if the mimeType supports encryption

func MatchesDigest

func MatchesDigest(manifest []byte, expectedDigest digest.Digest) (bool, error)

MatchesDigest returns true iff the manifest matches expectedDigest. Error may be set if this returns false. Note that this is not doing ConstantTimeCompare; by the time we get here, the cryptographic signature must already have been verified, or we are not using a cryptographic channel and the attacker can modify the digest along with the manifest blob.

func NormalizedMIMEType

func NormalizedMIMEType(input string) string

NormalizedMIMEType returns the effective MIME type of a manifest MIME type returned by a server, centralizing various workarounds.

func SupportedOCI1MediaType deprecated

func SupportedOCI1MediaType(m string) error

SupportedOCI1MediaType checks if the specified string is a supported OCI1 media type.

Deprecated: blindly rejecting unknown MIME types when the consumer does not need to process the input just reduces interoperability (and violates the standard) with no benefit, and that this function does not check that the media type is appropriate for any specific purpose, so it’s not all that useful for validation anyway.

func SupportedSchema2MediaType

func SupportedSchema2MediaType(m string) error

SupportedSchema2MediaType checks if the specified string is a supported Docker v2s2 media type.

Types

type LayerInfo

type LayerInfo struct {
	types.BlobInfo
	EmptyLayer bool // The layer is an “empty”/“throwaway” one, and may or may not be physically represented in various transport / storage systems.  false if the manifest type does not have the concept.
}

LayerInfo is an extended version of types.BlobInfo for low-level users of Manifest.LayerInfos.

type List

type List interface {
	// MIMEType returns the MIME type of this particular manifest list.
	MIMEType() string

	// Instances returns a list of the manifests that this list knows of, other than its own.
	Instances() []digest.Digest

	// Update information about the list's instances.  The length of the passed-in slice must
	// match the length of the list of instances which the list already contains, and every field
	// must be specified.
	UpdateInstances([]ListUpdate) error

	// Instance returns the size and MIME type of a particular instance in the list.
	Instance(digest.Digest) (ListUpdate, error)

	// ChooseInstance selects which manifest is most appropriate for the platform described by the
	// SystemContext, or for the current platform if the SystemContext doesn't specify any details.
	ChooseInstance(ctx *types.SystemContext) (digest.Digest, error)

	// Serialize returns the list in a blob format.
	// NOTE: Serialize() does not in general reproduce the original blob if this object was loaded
	// from, even if no modifications were made!
	Serialize() ([]byte, error)

	// ConvertToMIMEType returns the list rebuilt to the specified MIME type, or an error.
	ConvertToMIMEType(mimeType string) (List, error)

	// Clone returns a deep copy of this list and its contents.
	Clone() List
}

List is an interface for parsing, modifying lists of image manifests. Callers can either use this abstract interface without understanding the details of the formats, or instantiate a specific implementation (e.g. manifest.OCI1Index) and access the public members directly.

func ConvertListToMIMEType

func ConvertListToMIMEType(list List, manifestMIMEType string) (List, error)

ConvertListToMIMEType converts the passed-in manifest list to a manifest list of the specified type.

func ListFromBlob

func ListFromBlob(manifest []byte, manifestMIMEType string) (List, error)

ListFromBlob parses a list of manifests.

type ListUpdate

type ListUpdate struct {
	Digest    digest.Digest
	Size      int64
	MediaType string
}

ListUpdate includes the fields which a List's UpdateInstances() method will modify.

type Manifest

type Manifest interface {
	// ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object.
	ConfigInfo() types.BlobInfo
	// LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers).
	// The Digest field is guaranteed to be provided; Size may be -1.
	// WARNING: The list may contain duplicates, and they are semantically relevant.
	LayerInfos() []LayerInfo
	// UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls), in order (the root layer first, and then successive layered layers)
	UpdateLayerInfos(layerInfos []types.BlobInfo) error

	// ImageID computes an ID which can uniquely identify this image by its contents, irrespective
	// of which (of possibly more than one simultaneously valid) reference was used to locate the
	// image, and unchanged by whether or how the layers are compressed.  The result takes the form
	// of the hexadecimal portion of a digest.Digest.
	ImageID(diffIDs []digest.Digest) (string, error)

	// Inspect returns various information for (skopeo inspect) parsed from the manifest,
	// incorporating information from a configuration blob returned by configGetter, if
	// the underlying image format is expected to include a configuration blob.
	Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error)

	// Serialize returns the manifest in a blob format.
	// NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made!
	Serialize() ([]byte, error)
}

Manifest is an interface for parsing, modifying image manifests in isolation. Callers can either use this abstract interface without understanding the details of the formats, or instantiate a specific implementation (e.g. manifest.OCI1) and access the public members directly.

See types.Image for functionality not limited to manifests, including format conversions and config parsing. This interface is similar to, but not strictly equivalent to, the equivalent methods in types.Image.

func FromBlob

func FromBlob(manblob []byte, mt string) (Manifest, error)

FromBlob returns a Manifest instance for the specified manifest blob and the corresponding MIME type

type OCI1

type OCI1 struct {
	imgspecv1.Manifest
}

OCI1 is a manifest.Manifest implementation for OCI images. The underlying data from imgspecv1.Manifest is also available.

func OCI1Clone

func OCI1Clone(src *OCI1) *OCI1

OCI1Clone creates a copy of the supplied OCI1 manifest.

func OCI1FromComponents

func OCI1FromComponents(config imgspecv1.Descriptor, layers []imgspecv1.Descriptor) *OCI1

OCI1FromComponents creates an OCI1 manifest instance from the supplied data.

func OCI1FromManifest

func OCI1FromManifest(manifest []byte) (*OCI1, error)

OCI1FromManifest creates an OCI1 manifest instance from a manifest blob.

func (*OCI1) ConfigInfo

func (m *OCI1) ConfigInfo() types.BlobInfo

ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object.

func (*OCI1) ImageID

func (m *OCI1) ImageID([]digest.Digest) (string, error)

ImageID computes an ID which can uniquely identify this image by its contents.

func (*OCI1) Inspect

func (m *OCI1) Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error)

Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration.

func (*OCI1) LayerInfos

func (m *OCI1) LayerInfos() []LayerInfo

LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). The Digest field is guaranteed to be provided; Size may be -1. WARNING: The list may contain duplicates, and they are semantically relevant.

func (*OCI1) Serialize

func (m *OCI1) Serialize() ([]byte, error)

Serialize returns the manifest in a blob format. NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made!

func (*OCI1) UpdateLayerInfos

func (m *OCI1) UpdateLayerInfos(layerInfos []types.BlobInfo) error

UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls+mediatype), in order (the root layer first, and then successive layered layers)

type OCI1Index

type OCI1Index struct {
	imgspecv1.Index
}

OCI1Index is just an alias for the OCI index type, but one which we can provide methods for.

func OCI1IndexClone

func OCI1IndexClone(index *OCI1Index) *OCI1Index

OCI1IndexClone creates a deep copy of the passed-in index.

func OCI1IndexFromComponents

func OCI1IndexFromComponents(components []imgspecv1.Descriptor, annotations map[string]string) *OCI1Index

OCI1IndexFromComponents creates an OCI1 image index instance from the supplied data.

func OCI1IndexFromManifest

func OCI1IndexFromManifest(manifest []byte) (*OCI1Index, error)

OCI1IndexFromManifest creates an OCI1 manifest index instance from marshalled JSON, presumably generated by encoding a OCI1 manifest index.

func (*OCI1Index) ChooseInstance

func (index *OCI1Index) ChooseInstance(ctx *types.SystemContext) (digest.Digest, error)

ChooseInstance parses blob as an oci v1 manifest index, and returns the digest of the image which is appropriate for the current environment.

func (*OCI1Index) Clone

func (index *OCI1Index) Clone() List

Clone returns a deep copy of this list and its contents.

func (*OCI1Index) ConvertToMIMEType

func (index *OCI1Index) ConvertToMIMEType(manifestMIMEType string) (List, error)

ConvertToMIMEType converts the passed-in image index to a manifest list of the specified type.

func (*OCI1Index) Instance

func (index *OCI1Index) Instance(instanceDigest digest.Digest) (ListUpdate, error)

Instance returns the ListUpdate of a particular instance in the index.

func (*OCI1Index) Instances

func (index *OCI1Index) Instances() []digest.Digest

Instances returns a slice of digests of the manifests that this index knows of.

func (*OCI1Index) MIMEType

func (index *OCI1Index) MIMEType() string

MIMEType returns the MIME type of this particular manifest index.

func (*OCI1Index) Serialize

func (index *OCI1Index) Serialize() ([]byte, error)

Serialize returns the index in a blob format. NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made!

func (*OCI1Index) ToOCI1Index

func (index *OCI1Index) ToOCI1Index() (*OCI1Index, error)

ToOCI1Index returns the index encoded as an OCI1 index.

func (*OCI1Index) ToSchema2List

func (index *OCI1Index) ToSchema2List() (*Schema2List, error)

ToSchema2List returns the index encoded as a Schema2 list.

func (*OCI1Index) UpdateInstances

func (index *OCI1Index) UpdateInstances(updates []ListUpdate) error

UpdateInstances updates the sizes, digests, and media types of the manifests which the list catalogs.

type Schema1

type Schema1 struct {
	Name                     string                   `json:"name"`
	Tag                      string                   `json:"tag"`
	Architecture             string                   `json:"architecture"`
	FSLayers                 []Schema1FSLayers        `json:"fsLayers"`
	History                  []Schema1History         `json:"history"` // Keep this in sync with ExtractedV1Compatibility!
	ExtractedV1Compatibility []Schema1V1Compatibility `json:"-"`       // Keep this in sync with History! Does not contain the full config (Schema2V1Image)
	SchemaVersion            int                      `json:"schemaVersion"`
}

Schema1 is a manifest in docker/distribution schema 1.

func Schema1Clone

func Schema1Clone(src *Schema1) *Schema1

Schema1Clone creates a copy of the supplied Schema1 manifest.

func Schema1FromComponents

func Schema1FromComponents(ref reference.Named, fsLayers []Schema1FSLayers, history []Schema1History, architecture string) (*Schema1, error)

Schema1FromComponents creates an Schema1 manifest instance from the supplied data.

func Schema1FromManifest

func Schema1FromManifest(manifest []byte) (*Schema1, error)

Schema1FromManifest creates a Schema1 manifest instance from a manifest blob. (NOTE: The instance is not necessary a literal representation of the original blob, layers with duplicate IDs are eliminated.)

func (*Schema1) ConfigInfo

func (m *Schema1) ConfigInfo() types.BlobInfo

ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object.

func (*Schema1) ImageID

func (m *Schema1) ImageID(diffIDs []digest.Digest) (string, error)

ImageID computes an ID which can uniquely identify this image by its contents.

func (*Schema1) Inspect

func (m *Schema1) Inspect(_ func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error)

Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration.

func (*Schema1) LayerInfos

func (m *Schema1) LayerInfos() []LayerInfo

LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). The Digest field is guaranteed to be provided; Size may be -1. WARNING: The list may contain duplicates, and they are semantically relevant.

func (*Schema1) Serialize

func (m *Schema1) Serialize() ([]byte, error)

Serialize returns the manifest in a blob format. NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made!

func (*Schema1) ToSchema2Config

func (m *Schema1) ToSchema2Config(diffIDs []digest.Digest) ([]byte, error)

ToSchema2Config builds a schema2-style configuration blob using the supplied diffIDs.

func (*Schema1) UpdateLayerInfos

func (m *Schema1) UpdateLayerInfos(layerInfos []types.BlobInfo) error

UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls), in order (the root layer first, and then successive layered layers)

type Schema1FSLayers

type Schema1FSLayers struct {
	BlobSum digest.Digest `json:"blobSum"`
}

Schema1FSLayers is an entry of the "fsLayers" array in docker/distribution schema 1.

type Schema1History

type Schema1History struct {
	V1Compatibility string `json:"v1Compatibility"`
}

Schema1History is an entry of the "history" array in docker/distribution schema 1.

type Schema1V1Compatibility

type Schema1V1Compatibility struct {
	ID              string                                `json:"id"`
	Parent          string                                `json:"parent,omitempty"`
	Comment         string                                `json:"comment,omitempty"`
	Created         time.Time                             `json:"created"`
	ContainerConfig schema1V1CompatibilityContainerConfig `json:"container_config,omitempty"`
	Author          string                                `json:"author,omitempty"`
	ThrowAway       bool                                  `json:"throwaway,omitempty"`
}

Schema1V1Compatibility is a v1Compatibility in docker/distribution schema 1.

type Schema2

type Schema2 struct {
	SchemaVersion     int                 `json:"schemaVersion"`
	MediaType         string              `json:"mediaType"`
	ConfigDescriptor  Schema2Descriptor   `json:"config"`
	LayersDescriptors []Schema2Descriptor `json:"layers"`
}

Schema2 is a manifest in docker/distribution schema 2.

func Schema2Clone

func Schema2Clone(src *Schema2) *Schema2

Schema2Clone creates a copy of the supplied Schema2 manifest.

func Schema2FromComponents

func Schema2FromComponents(config Schema2Descriptor, layers []Schema2Descriptor) *Schema2

Schema2FromComponents creates an Schema2 manifest instance from the supplied data.

func Schema2FromManifest

func Schema2FromManifest(manifest []byte) (*Schema2, error)

Schema2FromManifest creates a Schema2 manifest instance from a manifest blob.

func (*Schema2) ConfigInfo

func (m *Schema2) ConfigInfo() types.BlobInfo

ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object.

func (*Schema2) ImageID

func (m *Schema2) ImageID([]digest.Digest) (string, error)

ImageID computes an ID which can uniquely identify this image by its contents.

func (*Schema2) Inspect

func (m *Schema2) Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error)

Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration.

func (*Schema2) LayerInfos

func (m *Schema2) LayerInfos() []LayerInfo

LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). The Digest field is guaranteed to be provided; Size may be -1. WARNING: The list may contain duplicates, and they are semantically relevant.

func (*Schema2) Serialize

func (m *Schema2) Serialize() ([]byte, error)

Serialize returns the manifest in a blob format. NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made!

func (*Schema2) UpdateLayerInfos

func (m *Schema2) UpdateLayerInfos(layerInfos []types.BlobInfo) error

UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls), in order (the root layer first, and then successive layered layers)

type Schema2Config

type Schema2Config struct {
	Hostname        string               // Hostname
	Domainname      string               // Domainname
	User            string               // User that will run the command(s) inside the container, also support user:group
	AttachStdin     bool                 // Attach the standard input, makes possible user interaction
	AttachStdout    bool                 // Attach the standard output
	AttachStderr    bool                 // Attach the standard error
	ExposedPorts    Schema2PortSet       `json:",omitempty"` // List of exposed ports
	Tty             bool                 // Attach standard streams to a tty, including stdin if it is not closed.
	OpenStdin       bool                 // Open stdin
	StdinOnce       bool                 // If true, close stdin after the 1 attached client disconnects.
	Env             []string             // List of environment variable to set in the container
	Cmd             strslice.StrSlice    // Command to run when starting the container
	Healthcheck     *Schema2HealthConfig `json:",omitempty"` // Healthcheck describes how to check the container is healthy
	ArgsEscaped     bool                 `json:",omitempty"` // True if command is already escaped (Windows specific)
	Image           string               // Name of the image as it was passed by the operator (e.g. could be symbolic)
	Volumes         map[string]struct{}  // List of volumes (mounts) used for the container
	WorkingDir      string               // Current directory (PWD) in the command will be launched
	Entrypoint      strslice.StrSlice    // Entrypoint to run when starting the container
	NetworkDisabled bool                 `json:",omitempty"` // Is network disabled
	MacAddress      string               `json:",omitempty"` // Mac Address of the container
	OnBuild         []string             // ONBUILD metadata that were defined on the image Dockerfile
	Labels          map[string]string    // List of labels set to this container
	StopSignal      string               `json:",omitempty"` // Signal to stop a container
	StopTimeout     *int                 `json:",omitempty"` // Timeout (in seconds) to stop a container
	Shell           strslice.StrSlice    `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT
}

Schema2Config is a Config in docker/docker/api/types/container.

type Schema2Descriptor

type Schema2Descriptor struct {
	MediaType string        `json:"mediaType"`
	Size      int64         `json:"size"`
	Digest    digest.Digest `json:"digest"`
	URLs      []string      `json:"urls,omitempty"`
}

Schema2Descriptor is a “descriptor” in docker/distribution schema 2.

type Schema2HealthConfig

type Schema2HealthConfig struct {
	// Test is the test to perform to check that the container is healthy.
	// An empty slice means to inherit the default.
	// The options are:
	// {} : inherit healthcheck
	// {"NONE"} : disable healthcheck
	// {"CMD", args...} : exec arguments directly
	// {"CMD-SHELL", command} : run command with system's default shell
	Test []string `json:",omitempty"`

	// Zero means to inherit. Durations are expressed as integer nanoseconds.
	StartPeriod time.Duration `json:",omitempty"` // StartPeriod is the time to wait after starting before running the first check.
	Interval    time.Duration `json:",omitempty"` // Interval is the time to wait between checks.
	Timeout     time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung.

	// Retries is the number of consecutive failures needed to consider a container as unhealthy.
	// Zero means inherit.
	Retries int `json:",omitempty"`
}

Schema2HealthConfig is a HealthConfig, which holds configuration settings for the HEALTHCHECK feature, from docker/docker/api/types/container.

type Schema2History

type Schema2History struct {
	// Created is the timestamp at which the image was created
	Created time.Time `json:"created"`
	// Author is the name of the author that was specified when committing the image
	Author string `json:"author,omitempty"`
	// CreatedBy keeps the Dockerfile command used while building the image
	CreatedBy string `json:"created_by,omitempty"`
	// Comment is the commit message that was set when committing the image
	Comment string `json:"comment,omitempty"`
	// EmptyLayer is set to true if this history item did not generate a
	// layer. Otherwise, the history item is associated with the next
	// layer in the RootFS section.
	EmptyLayer bool `json:"empty_layer,omitempty"`
}

Schema2History stores build commands that were used to create an image, from docker/docker/image.

type Schema2Image

type Schema2Image struct {
	Schema2V1Image
	Parent     digest.Digest    `json:"parent,omitempty"`
	RootFS     *Schema2RootFS   `json:"rootfs,omitempty"`
	History    []Schema2History `json:"history,omitempty"`
	OSVersion  string           `json:"os.version,omitempty"`
	OSFeatures []string         `json:"os.features,omitempty"`
}

Schema2Image is an Image in docker/docker/image.

type Schema2List

type Schema2List struct {
	SchemaVersion int                         `json:"schemaVersion"`
	MediaType     string                      `json:"mediaType"`
	Manifests     []Schema2ManifestDescriptor `json:"manifests"`
}

Schema2List is a list of platform-specific manifests.

func Schema2ListClone

func Schema2ListClone(list *Schema2List) *Schema2List

Schema2ListClone creates a deep copy of the passed-in list.

func Schema2ListFromComponents

func Schema2ListFromComponents(components []Schema2ManifestDescriptor) *Schema2List

Schema2ListFromComponents creates a Schema2 manifest list instance from the supplied data.

func Schema2ListFromManifest

func Schema2ListFromManifest(manifest []byte) (*Schema2List, error)

Schema2ListFromManifest creates a Schema2 manifest list instance from marshalled JSON, presumably generated by encoding a Schema2 manifest list.

func (*Schema2List) ChooseInstance

func (list *Schema2List) ChooseInstance(ctx *types.SystemContext) (digest.Digest, error)

ChooseInstance parses blob as a schema2 manifest list, and returns the digest of the image which is appropriate for the current environment.

func (*Schema2List) Clone

func (list *Schema2List) Clone() List

Clone returns a deep copy of this list and its contents.

func (*Schema2List) ConvertToMIMEType

func (list *Schema2List) ConvertToMIMEType(manifestMIMEType string) (List, error)

ConvertToMIMEType converts the passed-in manifest list to a manifest list of the specified type.

func (*Schema2List) Instance

func (list *Schema2List) Instance(instanceDigest digest.Digest) (ListUpdate, error)

Instance returns the ListUpdate of a particular instance in the list.

func (*Schema2List) Instances

func (list *Schema2List) Instances() []digest.Digest

Instances returns a slice of digests of the manifests that this list knows of.

func (*Schema2List) MIMEType

func (list *Schema2List) MIMEType() string

MIMEType returns the MIME type of this particular manifest list.

func (*Schema2List) Serialize

func (list *Schema2List) Serialize() ([]byte, error)

Serialize returns the list in a blob format. NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made!

func (*Schema2List) ToOCI1Index

func (list *Schema2List) ToOCI1Index() (*OCI1Index, error)

ToOCI1Index returns the list encoded as an OCI1 index.

func (*Schema2List) ToSchema2List

func (list *Schema2List) ToSchema2List() (*Schema2List, error)

ToSchema2List returns the list encoded as a Schema2 list.

func (*Schema2List) UpdateInstances

func (list *Schema2List) UpdateInstances(updates []ListUpdate) error

UpdateInstances updates the sizes, digests, and media types of the manifests which the list catalogs.

type Schema2ManifestDescriptor

type Schema2ManifestDescriptor struct {
	Schema2Descriptor
	Platform Schema2PlatformSpec `json:"platform"`
}

Schema2ManifestDescriptor references a platform-specific manifest.

type Schema2PlatformSpec

type Schema2PlatformSpec struct {
	Architecture string   `json:"architecture"`
	OS           string   `json:"os"`
	OSVersion    string   `json:"os.version,omitempty"`
	OSFeatures   []string `json:"os.features,omitempty"`
	Variant      string   `json:"variant,omitempty"`
	Features     []string `json:"features,omitempty"` // removed in OCI
}

Schema2PlatformSpec describes the platform which a particular manifest is specialized for.

type Schema2Port

type Schema2Port string

Schema2Port is a Port, a string containing port number and protocol in the format "80/tcp", from docker/go-connections/nat.

type Schema2PortSet

type Schema2PortSet map[Schema2Port]struct{}

Schema2PortSet is a PortSet, a collection of structs indexed by Port, from docker/go-connections/nat.

type Schema2RootFS

type Schema2RootFS struct {
	Type    string          `json:"type"`
	DiffIDs []digest.Digest `json:"diff_ids,omitempty"`
}

Schema2RootFS is a description of how to build up an image's root filesystem, from docker/docker/image.

type Schema2V1Image

type Schema2V1Image struct {
	// ID is a unique 64 character identifier of the image
	ID string `json:"id,omitempty"`
	// Parent is the ID of the parent image
	Parent string `json:"parent,omitempty"`
	// Comment is the commit message that was set when committing the image
	Comment string `json:"comment,omitempty"`
	// Created is the timestamp at which the image was created
	Created time.Time `json:"created"`
	// Container is the id of the container used to commit
	Container string `json:"container,omitempty"`
	// ContainerConfig is the configuration of the container that is committed into the image
	ContainerConfig Schema2Config `json:"container_config,omitempty"`
	// DockerVersion specifies the version of Docker that was used to build the image
	DockerVersion string `json:"docker_version,omitempty"`
	// Author is the name of the author that was specified when committing the image
	Author string `json:"author,omitempty"`
	// Config is the configuration of the container received from the client
	Config *Schema2Config `json:"config,omitempty"`
	// Architecture is the hardware that the image is built and runs on
	Architecture string `json:"architecture,omitempty"`
	// Variant is a variant of the CPU that the image is built and runs on
	Variant string `json:"variant,omitempty"`
	// OS is the operating system used to built and run the image
	OS string `json:"os,omitempty"`
	// Size is the total size of the image including all layers it is composed of
	Size int64 `json:",omitempty"`
}

Schema2V1Image is a V1Image in docker/docker/image.

Jump to

Keyboard shortcuts

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