layers

package
v0.0.0-...-67d9101 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

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

Docker needs a documetnation

func NewDocker

func NewDocker(globals *types.Global) (*Docker, error)

NewDocker needs a documetnation

func (*Docker) AddImage

func (d *Docker) AddImage(image string) error

AddImage adds layers to the layer list from a provided image, in order of appearance. Any existing layers are skipped over, removing them from the list.

func (*Docker) Fetch

func (d *Docker) Fetch(config *config.Config, name string) (string, error)

Fetch retrieves a docker image, overwrites the container configuration, and returns its id.

func (*Docker) Lookup

func (d *Docker) Lookup(config *config.Config, name string) (string, error)

Lookup an image by name, returning the id.

func (*Docker) MakeImage

func (d *Docker) MakeImage(config *config.Config) (string, error)

MakeImage makes the final image, skipping any layers as necessary. The layers must be pre-recorded within the executor. Note that if you have no layers to skip, this operation will need to do nothing, so it will do nothing.

It returns an error condition, if any.

func (*Docker) SetLayers

func (d *Docker) SetLayers(layers []string)

SetLayers sets the layers.

func (*Docker) SetSkipLayers

func (d *Docker) SetSkipLayers(ok bool)

SetSkipLayers toggles whether or not to skip layers that are being built next. Toggle again to re-enable layer recording. The final image will not contain the skipped layers.

type DockerImage

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

DockerImage is the Image interface applied to docker.

func NewDockerImage

func NewDockerImage(imageConfig *ImageConfig) (*DockerImage, error)

NewDockerImage contypes a new DockerImage

func (*DockerImage) CheckCache

func (d *DockerImage) CheckCache(cacheKey string) (bool, error)

CheckCache consults the cache and returns true or false depending on whether there was a match. If there was an error consulting the cache, it will be returned as the second argument.

func (*DockerImage) Flatten

func (d *DockerImage) Flatten(tw io.Reader) error

Flatten copies a tarred up series of files (passed in through the io.Reader handle) to the image where they are untarred.

func (*DockerImage) ImageID

func (d *DockerImage) ImageID() string

ImageID returns the image identifier of the most recent layer.

func (*DockerImage) Save

func (d *DockerImage) Save(filename, kind, tag string) error

Save saves an image to the provided filename.

func (*DockerImage) Tag

func (d *DockerImage) Tag(tag string) error

Tag an image with the provided string.

type Image

type Image interface {
	// Flatten copies a tarred up series of files (passed in through the
	// io.Reader handle) to the image where they are untarred. The first argument
	// is the parent image to use.
	Flatten(io.Reader) error

	// Tag the current layer. Takes a tag name as argument.
	Tag(string) error

	// CheckCache consults the cache to see if there are any items which fit it.
	CheckCache(string) (bool, error)

	// ImageID returns the image identifier of the most recent layer.
	ImageID() string

	// Save saves an image to the provided filename.
	Save(string, string, string) error
}

Image needs a description

type ImageConfig

type ImageConfig struct {
	Layers  Layers
	Config  *config.Config
	Globals *types.Global
}

ImageConfig sets the properties used to construct an image

type Layers

type Layers interface {
	// Pull an image. Takes a name and returns an image ID+error.
	Fetch(*config.Config, string) (string, error)

	// SetLayers sets the layers.
	SetLayers([]string)

	// AddImage adds layers to the layer list from a provided image, in order of
	// appearance. Any existing layers are skipped over, removing them from the list.
	AddImage(string) error

	// SetSkipLayers toggles whether or not to skip layers that are being built
	// next. Toggle again to re-enable layer recording. The final image will not
	// contain the skipped layers.
	SetSkipLayers(bool)

	// MakeImage makes the final image, skipping any layers as necessary. The
	// layers must be pre-recorded within the executor.
	// It returns an error condition, if any.
	MakeImage(config *config.Config) (string, error)

	// Look up an image identifier.
	Lookup(*config.Config, string) (string, error)
}

Layers needs a description

Jump to

Keyboard shortcuts

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