Documentation ¶
Overview ¶
Package docker provides a client for the Docker remote API.
See http://goo.gl/mxyql for more details on the remote API.
Index ¶
- Variables
- type AttachToContainerOptions
- type Client
- func (c *Client) AttachToContainer(opts AttachToContainerOptions) error
- func (c *Client) CommitContainer(opts CommitContainerOptions) (*docker.Image, error)
- func (c *Client) CreateContainer(config *docker.Config) (*docker.Container, error)
- func (c *Client) Info() (*docker.APIInfo, error)
- func (c *Client) InspectContainer(id string) (*docker.Container, error)
- func (c *Client) InspectImage(name string) (*docker.Image, error)
- func (c *Client) KillContainer(id string) error
- func (c *Client) ListContainers(opts ListContainersOptions) ([]docker.APIContainers, error)
- func (c *Client) ListImages(all bool) ([]docker.APIImages, error)
- func (c *Client) PullImage(opts PullImageOptions, w io.Writer) error
- func (c *Client) PushImage(opts PushImageOptions, w io.Writer) error
- func (c *Client) RemoveContainer(id string) error
- func (c *Client) RemoveImage(name string) error
- func (c *Client) RestartContainer(id string, timeout uint) error
- func (c *Client) StartContainer(id string) error
- func (c *Client) StopContainer(id string, timeout uint) error
- func (c *Client) Version() (*docker.APIVersion, error)
- func (c *Client) WaitContainer(id string) (int, error)
- type CommitContainerOptions
- type Error
- type ListContainersOptions
- type NoSuchContainer
- type PullImageOptions
- type PushImageOptions
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEndpoint is returned when the endpoint is not a valid HTTP URL. ErrInvalidEndpoint = errors.New("Invalid endpoint") // ErrConnectionRefused is returned when the client cannot connect to the given endpoint. ErrConnectionRefused = errors.New("Cannot connect to Docker endpoint") )
var ErrNoSuchImage = errors.New("No such image")
Error returned when the image does not exist.
Functions ¶
This section is empty.
Types ¶
type AttachToContainerOptions ¶
type AttachToContainerOptions struct { Container string InputFile *os.File OutputStream io.Writer ErrorStream io.Writer RawTerminal bool // Get container logs, sending it to OutputStream. Logs bool // Stream the response? Stream bool // Attach to stdin, and use InputFile. Stdin bool // Attach to stdout, and use OutputStream. Stdout bool // Attach to stderr, and use ErrorStream. Stderr bool }
AttachToContainerOptions is the set of options that can be used when attaching to a container.
See http://goo.gl/APgKE for more details.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the basic type of this package. It provides methods for interaction with the API.
func NewClient ¶
NewClient returns a Client instance ready for communication with the given server endpoint.
func (*Client) AttachToContainer ¶
func (c *Client) AttachToContainer(opts AttachToContainerOptions) error
AttachToContainer attaches to a container, using the given options.
See http://goo.gl/APgKE for more details.
func (*Client) CommitContainer ¶
func (c *Client) CommitContainer(opts CommitContainerOptions) (*docker.Image, error)
CommitContainer creates a new image from a container's changes.
See http://goo.gl/qYrAF for more details.
func (*Client) CreateContainer ¶
CreateContainer creates a new container, returning the container instance, or an error in case of failure.
See http://goo.gl/lcR51 for more details.
func (*Client) Info ¶
Info returns system-wide information, like the number of running containers.
See http://goo.gl/9eYZF for more details.
func (*Client) InspectContainer ¶
InspectContainer returns information about a container by its ID.
See http://goo.gl/g5tpG for more details.
func (*Client) InspectImage ¶
InspectImage returns an image by its name or ID.
See http://goo.gl/dqGQO for more details.
func (*Client) KillContainer ¶
KillContainer kills a container, returning an error in case of failure.
See http://goo.gl/DfPJC for more details.
func (*Client) ListContainers ¶
func (c *Client) ListContainers(opts ListContainersOptions) ([]docker.APIContainers, error)
ListContainers returns a slice of containers matching the given criteria.
See http://goo.gl/8IMr2 for more details.
func (*Client) ListImages ¶
ListImages returns the list of available images in the server.
See http://goo.gl/5ZfHk for more details.
func (*Client) PullImage ¶
func (c *Client) PullImage(opts PullImageOptions, w io.Writer) error
PullImage pulls an image from a remote registry, logging progress to w.
See http://goo.gl/JSltN for more details.
func (*Client) PushImage ¶
func (c *Client) PushImage(opts PushImageOptions, w io.Writer) error
PushImage pushes an image to a remote registry, logging progress to w.
See http://goo.gl/Hx3CB for more details.
func (*Client) RemoveContainer ¶
RemoveContainer removes a container, returning an error in case of failure.
See http://goo.gl/vCybY for more details.
func (*Client) RemoveImage ¶
RemoveImage removes an image by its name or ID.
See http://goo.gl/J2FNF for more details.
func (*Client) RestartContainer ¶
RestartContainer stops a container, killing it after the given timeout (in seconds), during the stop process.
See http://goo.gl/n3S9r for more details.
func (*Client) StartContainer ¶
StartContainer starts a container, returning an errror in case of failure.
See http://goo.gl/QipuL for more details.
func (*Client) StopContainer ¶
StopContainer stops a container, killing it after the given timeout (in seconds).
See http://goo.gl/bXrXM for more details.
func (*Client) Version ¶
func (c *Client) Version() (*docker.APIVersion, error)
Version returns version information about the docker server.
func (*Client) WaitContainer ¶
WaitContainer blocks until the given container stops, return the exit code of the container status.
See http://goo.gl/MtAmo for more details.
type CommitContainerOptions ¶
type CommitContainerOptions struct { Container string Repository string `qs:"repo"` Tag string Message string `qs:"m"` Author string Run *docker.Config }
CommitContainerOptions aggregates parameters to the CommitContainer method.
See http://goo.gl/qYrAF for more details.
type ListContainersOptions ¶
ListContainersOptions specify parameters to the ListContainers function.
See http://goo.gl/8IMr2 for more details.
type NoSuchContainer ¶
type NoSuchContainer struct {
ID string
}
NoSuchContainer is the error returned when a given container does not exist.
func (*NoSuchContainer) Error ¶
func (err *NoSuchContainer) Error() string
type PullImageOptions ¶
PullImageOptions present the set of options available for pulling an image from a registry.
See http://goo.gl/JSltN for more details.
type PushImageOptions ¶
type PushImageOptions struct { // Name of the image Name string // Registry server to push the image Registry string }
PushImageOptions options to use in the PushImage method.