docker

package
v0.0.0-...-215933a Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient interface {
	FindImage(string) (*dc.Image, error)
	PullImage(string, string) error
	FindContainer(string) (*dc.Container, error)
	CreateContainer(dc.CreateContainerOptions) (*dc.Container, error)
	StartContainer(string, string) error
}

APIClient provides access to docker

type Client

type Client struct {
	*dc.Client
	PullInactivityTimeout time.Duration
}

Client provides api access to Docker

func NewDockerClient

func NewDockerClient() (*Client, error)

NewDockerClient returns a docker client with the default configuration

func (*Client) CreateContainer

func (c *Client) CreateContainer(opts dc.CreateContainerOptions) (*dc.Container, error)

CreateContainer creates a container with the specified options

func (*Client) FindContainer

func (c *Client) FindContainer(name string) (*dc.Container, error)

FindContainer returns a container matching the specified name

func (*Client) FindImage

func (c *Client) FindImage(repoTag string) (*dc.Image, error)

FindImage finds a local docker image with the specified repo tag

func (*Client) PullImage

func (c *Client) PullImage(name, tag string) error

PullImage pulls an image with the specified name and tag

func (*Client) StartContainer

func (c *Client) StartContainer(name, containerID string) error

StartContainer starts the container with the specified ID

type Port

type Port struct {
	dc.Port
}

Port represents a docker port specification

func NewPort

func NewPort(s string) Port

NewPort creates a new Port

func (Port) PortNum

func (p Port) PortNum() string

PortNum returns the port as a string

func (Port) String

func (p Port) String() string

String returns the port as a string with Port and Protocol

func (Port) ToDockerClientPort

func (p Port) ToDockerClientPort() dc.Port

ToDockerClientPort returns a dc.Port from a Port

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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