image

package
v1.10.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2016 License: Apache-2.0 Imports: 13 Imported by: 2,626

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter added in v1.10.0

type Exporter interface {
	Load(io.ReadCloser, io.Writer) error
	// TODO: Load(net.Context, io.ReadCloser, <- chan StatusMessage) error
	Save([]string, io.Writer) error
}

Exporter provides interface for exporting and importing images

type History added in v1.10.0

type History struct {
	// Created timestamp for build point
	Created time.Time `json:"created"`
	// Author of the build point
	Author string `json:"author,omitempty"`
	// CreatedBy keeps the Dockerfile command used while building image.
	CreatedBy string `json:"created_by,omitempty"`
	// Comment is custom message set by the user when creating 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"`
}

History stores build commands that were used to create an image

type ID added in v1.10.0

type ID digest.Digest

ID is the content-addressable ID of an image.

func (ID) String added in v1.10.0

func (id ID) String() string

type IDWalkFunc added in v1.10.0

type IDWalkFunc func(id ID) error

IDWalkFunc is function called by StoreBackend.Walk

type Image

type Image struct {
	V1Image
	Parent  ID        `json:"parent,omitempty"`
	RootFS  *RootFS   `json:"rootfs,omitempty"`
	History []History `json:"history,omitempty"`
	// contains filtered or unexported fields
}

Image stores the image configuration

func NewFromJSON added in v1.10.0

func NewFromJSON(src []byte) (*Image, error)

NewFromJSON creates an Image configuration from json.

func (*Image) ID

func (img *Image) ID() ID

ID returns the image's content-addressable ID.

func (*Image) MarshalJSON added in v1.10.0

func (img *Image) MarshalJSON() ([]byte, error)

MarshalJSON serializes the image to JSON. It sorts the top-level keys so that JSON that's been manipulated by a push/pull cycle with a legacy registry won't end up with a different key order.

func (*Image) RawJSON added in v1.10.0

func (img *Image) RawJSON() []byte

RawJSON returns the immutable JSON associated with the image.

type LayerGetReleaser added in v1.10.0

type LayerGetReleaser interface {
	Get(layer.ChainID) (layer.Layer, error)
	Release(layer.Layer) ([]layer.Metadata, error)
}

LayerGetReleaser is a minimal interface for getting and releasing images.

type RootFS added in v1.10.0

type RootFS struct {
	Type    string         `json:"type"`
	DiffIDs []layer.DiffID `json:"diff_ids,omitempty"`
}

RootFS describes images root filesystem This is currently a placeholder that only supports layers. In the future this can be made into a interface that supports different implementations.

func NewRootFS added in v1.10.0

func NewRootFS() *RootFS

NewRootFS returns empty RootFS struct

func (*RootFS) Append added in v1.10.0

func (r *RootFS) Append(id layer.DiffID)

Append appends a new diffID to rootfs

func (*RootFS) ChainID added in v1.10.0

func (r *RootFS) ChainID() layer.ChainID

ChainID returns the ChainID for the top layer in RootFS.

type Store added in v1.10.0

type Store interface {
	Create(config []byte) (ID, error)
	Get(id ID) (*Image, error)
	Delete(id ID) ([]layer.Metadata, error)
	Search(partialID string) (ID, error)
	SetParent(id ID, parent ID) error
	GetParent(id ID) (ID, error)
	Children(id ID) []ID
	Map() map[ID]*Image
	Heads() map[ID]*Image
}

Store is an interface for creating and accessing images

func NewImageStore added in v1.10.0

func NewImageStore(fs StoreBackend, ls LayerGetReleaser) (Store, error)

NewImageStore returns new store object for given layer store

type StoreBackend added in v1.10.0

type StoreBackend interface {
	Walk(f IDWalkFunc) error
	Get(id ID) ([]byte, error)
	Set(data []byte) (ID, error)
	Delete(id ID) error
	SetMetadata(id ID, key string, data []byte) error
	GetMetadata(id ID, key string) ([]byte, error)
	DeleteMetadata(id ID, key string) error
}

StoreBackend provides interface for image.Store persistence

func NewFSStoreBackend added in v1.10.0

func NewFSStoreBackend(root string) (StoreBackend, error)

NewFSStoreBackend returns new filesystem based backend for image.Store

type V1Image added in v1.10.0

type V1Image struct {
	// ID a unique 64 character identifier of the image
	ID string `json:"id,omitempty"`
	// Parent id of the image
	Parent string `json:"parent,omitempty"`
	// Comment user added comment
	Comment string `json:"comment,omitempty"`
	// Created timestamp when 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 container.Config `json:"container_config,omitempty"`
	// DockerVersion specifies version on which image is built
	DockerVersion string `json:"docker_version,omitempty"`
	// Author of the image
	Author string `json:"author,omitempty"`
	// Config is the configuration of the container received from the client
	Config *container.Config `json:"config,omitempty"`
	// Architecture is the hardware that the image is build and runs on
	Architecture string `json:"architecture,omitempty"`
	// OS is the operating system used to build 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"`
}

V1Image stores the V1 image configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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