dockerutil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FakePull added in v0.10.0

func FakePull(img image.Image, w io.Writer) error

FakePull writes a jsonmessage stream to w that looks like a Docker pull.

func NewDockerClient

func NewDockerClient(socket, certPath string) (*docker.Client, error)

NewDockerClient returns a new docker.Client using the given socket and certificate path.

func NewDockerClientFromEnv

func NewDockerClientFromEnv() (*docker.Client, error)

NewDockerClientFromEnv returns a new docker client configured by the DOCKER_* environment variables.

Types

type Client

type Client struct {
	*docker.Client

	// Auth is the docker.AuthConfiguration that will be used for pulling
	// images.
	Auth *docker.AuthConfigurations
}

Client wraps a docker.Client to authenticate pulls.

func NewClient

func NewClient(auth *docker.AuthConfigurations, socket, certPath string) (*Client, error)

NewClient returns a new Client instance.

func NewClientFromEnv

func NewClientFromEnv(auth *docker.AuthConfigurations) (*Client, error)

NewClientFromEnv returns a new Client instance configured by the DOCKER_* environment variables.

func (*Client) AttachToContainer

func (c *Client) AttachToContainer(ctx context.Context, opts docker.AttachToContainerOptions) error

func (*Client) CreateContainer

func (c *Client) CreateContainer(ctx context.Context, opts docker.CreateContainerOptions) (*docker.Container, error)

func (*Client) PullImage

func (c *Client) PullImage(ctx context.Context, opts docker.PullImageOptions) error

PullImage wraps the docker clients PullImage to handle authentication.

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(ctx context.Context, opts docker.RemoveContainerOptions) error

func (*Client) StartContainer

func (c *Client) StartContainer(ctx context.Context, id string, config *docker.HostConfig) error

func (*Client) StopContainer

func (c *Client) StopContainer(ctx context.Context, id string, timeout uint) error

type DecodedJSONMessageWriter added in v0.10.0

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

DecodedJSONMessageWriter is an io.Writer that decodes a jsonmessage stream.

func DecodeJSONMessageStream added in v0.10.0

func DecodeJSONMessageStream(w io.Writer) *DecodedJSONMessageWriter

DecodeJSONMessageStream wraps an io.Writer to decode a jsonmessage stream into plain text. Bytes written to w represent the decoded plain text stream.

func (*DecodedJSONMessageWriter) Err added in v0.10.0

Err returns the jsonmessage.Error that occurred, if any.

func (*DecodedJSONMessageWriter) Write added in v0.10.0

func (w *DecodedJSONMessageWriter) Write(b []byte) (int, error)

Write decodes the jsonmessage stream in the bytes, and writes the decoded plain text to the underlying io.Writer.

Jump to

Keyboard shortcuts

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