docker

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScriptsURL = "STI_SCRIPTS_URL"
	Location   = "STI_LOCATION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildImageOptions

type BuildImageOptions struct {
	Name   string
	Stdin  io.Reader
	Stdout io.Writer
}

BuildImageOptions are options passed in to the BuildImage method

type Client

type Client interface {
	RemoveImage(name string) error
	InspectImage(name string) (*docker.Image, error)
	PullImage(opts docker.PullImageOptions, auth docker.AuthConfiguration) error
	CreateContainer(opts docker.CreateContainerOptions) (*docker.Container, error)
	AttachToContainer(opts docker.AttachToContainerOptions) error
	StartContainer(id string, hostConfig *docker.HostConfig) error
	WaitContainer(id string) (int, error)
	RemoveContainer(opts docker.RemoveContainerOptions) error
	CommitContainer(opts docker.CommitContainerOptions) (*docker.Image, error)
	CopyFromContainer(opts docker.CopyFromContainerOptions) error
	BuildImage(opts docker.BuildImageOptions) error
}

Client contains all methods called on the go Docker client.

type CommitContainerOptions

type CommitContainerOptions struct {
	ContainerID string
	Repository  string
	Command     []string
	Env         []string
}

CommitContainerOptions are options passed in to the CommitContainer method

type Docker

type Docker interface {
	IsImageInLocalRegistry(name string) (bool, error)
	IsImageOnBuild(string) bool
	RemoveContainer(id string) error
	GetScriptsURL(name string) (string, error)
	RunContainer(opts RunContainerOptions) error
	GetImageID(name string) (string, error)
	CommitContainer(opts CommitContainerOptions) (string, error)
	RemoveImage(name string) error
	PullImage(name string) (*docker.Image, error)
	CheckAndPull(name string) (*docker.Image, error)
	BuildImage(opts BuildImageOptions) error
	GetImageUser(name string) (string, error)
}

Docker is the interface between STI and the Docker client It contains higher level operations called from the STI build or usage commands

func New

func New(endpoint string) (Docker, error)

New creates a new implementation of the STI Docker interface

type PostExecutor

type PostExecutor interface {
	PostExecute(containerID string, location string) error
}

type PullResult

type PullResult struct {
	OnBuild bool
	Image   *docker.Image
}

type RunContainerOptions

type RunContainerOptions struct {
	Image           string
	PullImage       bool
	ExternalScripts bool
	ScriptsURL      string
	Location        string
	Command         string
	Env             []string
	Stdin           io.Reader
	Stdout          io.Writer
	Stderr          io.Writer
	OnStart         func() error
	PostExec        PostExecutor
}

RunContainerOptions are options passed in to the RunContainer method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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