docker: Index | Files

package schema2

import ""


Package Files

builder.go manifest.go


const (
    // MediaTypeManifest specifies the mediaType for the current version.
    MediaTypeManifest = "application/vnd.docker.distribution.manifest.v2+json"

    // MediaTypeImageConfig specifies the mediaType for the image configuration.
    MediaTypeImageConfig = "application/vnd.docker.container.image.v1+json"

    // MediaTypePluginConfig specifies the mediaType for plugin configuration.
    MediaTypePluginConfig = "application/vnd.docker.plugin.v1+json"

    // MediaTypeLayer is the mediaType used for layers referenced by the
    // manifest.
    MediaTypeLayer = "application/vnd.docker.image.rootfs.diff.tar.gzip"

    // MediaTypeForeignLayer is the mediaType used for layers that must be
    // downloaded from foreign URLs.
    MediaTypeForeignLayer = "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip"

    // MediaTypeUncompressedLayer is the mediaType used for layers which
    // are not compressed.
    MediaTypeUncompressedLayer = "application/vnd.docker.image.rootfs.diff.tar"


var (
    // SchemaVersion provides a pre-initialized version structure for this
    // packages version of the manifest.
    SchemaVersion = manifest.Versioned{
        SchemaVersion: 2,
        MediaType:     MediaTypeManifest,

func NewManifestBuilder Uses

func NewManifestBuilder(bs distribution.BlobService, configMediaType string, configJSON []byte) distribution.ManifestBuilder

NewManifestBuilder is used to build new manifests for the current schema version. It takes a BlobService so it can publish the configuration blob as part of the Build process.

type DeserializedManifest Uses

type DeserializedManifest struct {
    // contains filtered or unexported fields

DeserializedManifest wraps Manifest with a copy of the original JSON. It satisfies the distribution.Manifest interface.

func FromStruct Uses

func FromStruct(m Manifest) (*DeserializedManifest, error)

FromStruct takes a Manifest structure, marshals it to JSON, and returns a DeserializedManifest which contains the manifest and its JSON representation.

func (*DeserializedManifest) MarshalJSON Uses

func (m *DeserializedManifest) MarshalJSON() ([]byte, error)

MarshalJSON returns the contents of canonical. If canonical is empty, marshals the inner contents.

func (DeserializedManifest) Payload Uses

func (m DeserializedManifest) Payload() (string, []byte, error)

Payload returns the raw content of the manifest. The contents can be used to calculate the content identifier.

func (*DeserializedManifest) UnmarshalJSON Uses

func (m *DeserializedManifest) UnmarshalJSON(b []byte) error

UnmarshalJSON populates a new Manifest struct from JSON data.

type Manifest Uses

type Manifest struct {

    // Config references the image configuration as a blob.
    Config distribution.Descriptor `json:"config"`

    // Layers lists descriptors for the layers referenced by the
    // configuration.
    Layers []distribution.Descriptor `json:"layers"`

Manifest defines a schema2 manifest.

func (Manifest) References Uses

func (m Manifest) References() []distribution.Descriptor

References returns the descriptors of this manifests references.

func (Manifest) Target Uses

func (m Manifest) Target() distribution.Descriptor

Target returns the target of this manifest.

Package schema2 imports 7 packages (graph). Updated 2019-04-10. Refresh now. Tools for package owners.