docker

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: Apache-2.0 Imports: 21 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 implements an executor that talks to docker to achieve its goals.

func NewDocker

func NewDocker(useCache, tty bool) (*Docker, error)

NewDocker constructs a new docker instance, for executing against docker engines.

func (*Docker) CheckCache

func (d *Docker) 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 (*Docker) Commit

func (d *Docker) Commit(cacheKey string, hook executor.Hook) error

Commit commits an entry to the layer list.

func (*Docker) Config

func (d *Docker) Config() *config.Config

Config returns the current *Config for the executor.

func (*Docker) CopyFromContainer

func (d *Docker) CopyFromContainer(id, path string) (io.Reader, int64, error)

CopyFromContainer copies a series of files in a similar fashion to CopyToContainer, just in reverse.

func (*Docker) CopyOneFileFromContainer

func (d *Docker) CopyOneFileFromContainer(fn string) ([]byte, error)

CopyOneFileFromContainer copies a file from the container and returns its content. An error is returned, if any.

func (*Docker) CopyToContainer

func (d *Docker) CopyToContainer(id string, r io.Reader) error

CopyToContainer copies files from the tarfile specified in reader to the containerto the container so it can then be committed. It does not close the reader.

func (*Docker) Create

func (d *Docker) Create() (string, error)

Create creates a new container based on the existing configuration.

func (*Docker) Destroy

func (d *Docker) Destroy(id string) error

Destroy destroys a container for the given id.

func (*Docker) Fetch

func (d *Docker) Fetch(name string) (string, error)

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

func (*Docker) Flatten added in v0.3.1

func (d *Docker) Flatten(id string, size int64, 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 (*Docker) ImageID

func (d *Docker) ImageID() string

ImageID returns the image identifier of the most recent layer.

func (*Docker) LoadConfig

func (d *Docker) LoadConfig(c *config.Config) error

LoadConfig loads the configuration into the executor.

func (*Docker) MakeImage added in v0.3.1

func (d *Docker) MakeImage() 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) RunHook

func (d *Docker) RunHook(id string) (string, error)

RunHook is the run hook for docker agents.

func (*Docker) SetSkipLayers added in v0.3.1

func (d *Docker) SetSkipLayers(ok bool)

SetSkipLayers toggles whether or not to skip layers when building the final image.

func (*Docker) SetStdin

func (d *Docker) SetStdin(on bool)

SetStdin turns on the stdin features during run invocations. It is used to facilitate debugging.

func (*Docker) Tag

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

Tag an image with the provided string.

func (*Docker) UseCache

func (d *Docker) UseCache(arg bool)

UseCache determines if the cache should be considered or not.

func (*Docker) UseTTY

func (d *Docker) UseTTY(arg bool)

UseTTY determines whether or not to allow docker to use a TTY for both run and pull operations.

Jump to

Keyboard shortcuts

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