Documentation ¶
Index ¶
- type Docker
- func (d *Docker) AddImage(image string) error
- func (d *Docker) Fetch(config *config.Config, name string) (string, error)
- func (d *Docker) Lookup(config *config.Config, name string) (string, error)
- func (d *Docker) MakeImage(config *config.Config) (string, error)
- func (d *Docker) SetContext(ctx context.Context)
- func (d *Docker) SetLayers(layers []string)
- func (d *Docker) SetSkipLayers(ok bool)
- type DockerImage
- func (d *DockerImage) CheckCache(cacheKey string) (bool, error)
- func (d *DockerImage) Flatten(id string, size int64, tw io.Reader) error
- func (d *DockerImage) GetCache() bool
- func (d *DockerImage) ImageID() string
- func (d *DockerImage) Save(filename, kind, tag string) error
- func (d *DockerImage) SetContext(ctx context.Context)
- func (d *DockerImage) Tag(tag string) error
- func (d *DockerImage) UseCache(arg bool)
- type Image
- type ImageConfig
- type Layers
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 (*Docker) AddImage ¶
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 ¶
Fetch retrieves a docker image, overwrites the container configuration, and returns its id.
func (*Docker) MakeImage ¶
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) SetContext ¶
SetContext sets the context for subsequent calls.
func (*Docker) SetSkipLayers ¶
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(context context.Context, imageConfig *ImageConfig) (*DockerImage, error)
NewDockerImage constructs 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 ¶
Flatten copies a tarred up series of files (passed in through the io.Reader handle) to the image where they are untarred.
func (*DockerImage) GetCache ¶
func (d *DockerImage) GetCache() bool
GetCache gets the current value of whether or not to use the cache
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) SetContext ¶
func (d *DockerImage) SetContext(ctx context.Context)
SetContext sets the current context for execution
func (*DockerImage) Tag ¶
func (d *DockerImage) Tag(tag string) error
Tag an image with the provided string.
func (*DockerImage) UseCache ¶
func (d *DockerImage) UseCache(arg bool)
UseCache determines if the cache should be considered or not.
type Image ¶
type Image interface { // SetContext sets the context for upcoming operations. SetContext(context.Context) // 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(string, int64, 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) // UseCache determines if the cache should be considered or not. UseCache(bool) // GetCache gets the current value of whether or not to use the cache GetCache() bool // 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 ¶
ImageConfig sets the properties used to construct an
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) // SetContext sets the context for subsequent calls. SetContext(ctx context.Context) }
Layers needs a description