docker_helpers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2016 License: MIT Imports: 16 Imported by: 87

Documentation

Index

Constants

View Source
const DefaultDockerRegistry = "docker.io"

DefaultDockerRegistry is the name of the index

Variables

This section is empty.

Functions

func Close

func Close(client Client)

func ReadDockerAuthConfigs

func ReadDockerAuthConfigs(homeDir string) (*docker.AuthConfigurations, error)

func ResolveDockerAuthConfig

func ResolveDockerAuthConfig(indexName string, configs *docker.AuthConfigurations) *docker.AuthConfiguration

ResolveDockerAuthConfig taken from: https://github.com/docker/docker/blob/master/registry/auth.go

func SplitDockerImageName

func SplitDockerImageName(reposName string) (string, string)

SplitDockerImageName breaks a reposName into an index name and remote name

Types

type Client

type Client interface {
	InspectImage(name string) (*docker.Image, error)
	PullImage(opts docker.PullImageOptions, auth docker.AuthConfiguration) error
	LoadImage(opts docker.LoadImageOptions) error

	CreateContainer(opts docker.CreateContainerOptions) (*docker.Container, error)
	StartContainer(id string, hostConfig *docker.HostConfig) error
	WaitContainer(id string) (int, error)
	InspectContainer(id string) (*docker.Container, error)
	AttachToContainer(opts docker.AttachToContainerOptions) error
	RemoveContainer(opts docker.RemoveContainerOptions) error
	Logs(opts docker.LogsOptions) error
}

func New

func New(c DockerCredentials, apiVersion string) (client Client, err error)

type DockerCredentials

type DockerCredentials struct {
	Host      string `toml:"host,omitempty" json:"host" long:"host" env:"DOCKER_HOST" description:"Docker daemon address"`
	CertPath  string `toml:"tls_cert_path,omitempty" json:"tls_cert_path" long:"cert-path" env:"DOCKER_CERT_PATH" description:"Certificate path"`
	TLSVerify bool   `` /* 129-byte string literal not displayed */
}

type Machine

type Machine interface {
	Create(driver, name string, opts ...string) error
	Provision(name string) error
	Remove(name string) error
	List(nodeFilter string) (machines []string, err error)

	CanConnect(name string) bool
	Credentials(name string) (DockerCredentials, error)
}

func NewMachineCommand

func NewMachineCommand() Machine

Jump to

Keyboard shortcuts

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