image

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2018 License: Apache-2.0 Imports: 28 Imported by: 6 modules, 19 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DockerArchive is the transport we prepend to an image name
	// when saving to docker-archive
	DockerArchive = dockerarchive.Transport.Name()
	// OCIArchive is the transport we prepend to an image name
	// when saving to oci-archive
	OCIArchive = ociarchive.Transport.Name()
	// DirTransport is the transport for pushing and pulling
	// images to and from a directory
	DirTransport = directory.Transport.Name()
	// TransportNames are the supported transports in string form
	TransportNames = [...]string{DefaultTransport, DockerArchive, OCIArchive, "ostree:", "dir:"}
	// TarballTransport is the transport for importing a tar archive
	// and creating a filesystem image
	TarballTransport = tarball.Transport.Name()
	// DockerTransport is the transport for docker registries
	DockerTransport = docker.Transport.Name() + "://"
	// AtomicTransport is the transport for atomic registries
	AtomicTransport = "atomic"
	// DefaultTransport is a prefix that we apply to an image name
	DefaultTransport = DockerTransport
)

Functions

func GetSystemContext added in v0.3.3

func GetSystemContext(signaturePolicyPath, authFilePath string, forceCompress bool) *types.SystemContext

GetSystemContext Constructs a new containers/image/types.SystemContext{} struct from the given signaturePolicy path

Types

type DockerRegistryOptions added in v0.3.3

type DockerRegistryOptions struct {
	// DockerRegistryCreds is the user name and password to supply in case
	// we need to pull an image from a registry, and it requires us to
	// authenticate.
	DockerRegistryCreds *types.DockerAuthConfig
	// DockerCertPath is the location of a directory containing CA
	// certificates which will be used to verify the registry's certificate
	// (all files with names ending in ".crt"), and possibly client
	// certificates and private keys (pairs of files with the same name,
	// except for ".cert" and ".key" suffixes).
	DockerCertPath string
	// DockerInsecureSkipTLSVerify turns off verification of TLS
	// certificates and allows connecting to registries without encryption.
	DockerInsecureSkipTLSVerify bool
}

DockerRegistryOptions encapsulates settings that affect how we connect or authenticate to a remote registry.

func (DockerRegistryOptions) GetSystemContext added in v0.3.3

func (o DockerRegistryOptions) GetSystemContext(signaturePolicyPath, authFile string, forceCompress bool) *types.SystemContext

GetSystemContext constructs a new system context from the given signaturePolicy path and the values in the DockerRegistryOptions

type Image

type Image struct {
	inspect.ImageData
	InputName string
	Local     bool
	// contains filtered or unexported fields
}

Image is the primary struct for dealing with images It is still very much a work in progress

func (*Image) Created added in v0.3.3

func (i *Image) Created() time.Time

Created returns the time the image was created

func (*Image) Decompose added in v0.3.3

func (i *Image) Decompose() error

Decompose an Image

func (*Image) Digest added in v0.3.3

func (i *Image) Digest() digest.Digest

Digest returns the image's Manifest

func (*Image) ID

func (i *Image) ID() string

ID returns the image ID as a string

func (*Image) MatchesID added in v0.3.3

func (i *Image) MatchesID(id string) bool

MatchesID returns a bool based on if the input id matches the image's id

func (*Image) Names added in v0.3.3

func (i *Image) Names() []string

Names returns a string array of names associated with the image

func (*Image) PushImage added in v0.3.3

func (i *Image) PushImage(destination, manifestMIMEType, authFile, signaturePolicyPath string, writer io.Writer, forceCompress bool, signingOptions SigningOptions, dockerRegistryOptions *DockerRegistryOptions) error

PushImage pushes the given image to a location described by the given path

func (*Image) Remove

func (i *Image) Remove(force bool) error

Remove an image; container removal for the image must be done outside the context of images

func (*Image) Size added in v0.3.3

func (i *Image) Size() (*uint64, error)

Size returns the size of the image

func (*Image) TagImage added in v0.3.3

func (i *Image) TagImage(tag string) error

TagImage adds a tag to the given image

func (*Image) TopLayer added in v0.3.3

func (i *Image) TopLayer() string

TopLayer returns the top layer id as a string

type Runtime added in v0.3.3

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime contains the store

func NewImageRuntime added in v0.3.3

func NewImageRuntime(options storage.StoreOptions) (*Runtime, error)

NewImageRuntime creates an Image Runtime including the store given store options

func (*Runtime) GetImages added in v0.3.3

func (ir *Runtime) GetImages() ([]*Image, error)

GetImages retrieves all images present in storage

func (*Runtime) New added in v0.3.3

func (ir *Runtime) New(name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *DockerRegistryOptions, signingoptions SigningOptions) (*Image, error)

New creates a new image object where the image could be local or remote

func (*Runtime) NewFromLocal added in v0.3.3

func (ir *Runtime) NewFromLocal(name string) (*Image, error)

NewFromLocal creates a new image object that is intended to only deal with local images already in the store (or its aliases)

func (*Runtime) Shutdown added in v0.3.3

func (ir *Runtime) Shutdown(force bool) error

Shutdown closes down the storage and require a bool arg as to whether it should do so forcibly.

type SigningOptions added in v0.3.3

type SigningOptions struct {
	// RemoveSignatures directs us to remove any signatures which are already present.
	RemoveSignatures bool
	// SignBy is a key identifier of some kind, indicating that a signature should be generated using the specified private key and stored with the image.
	SignBy string
}

SigningOptions encapsulates settings that control whether or not we strip or add signatures to images when writing them.

Jump to

Keyboard shortcuts

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