dockerutils

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportAuthConfigsFromDockerCfg added in v0.4.1

func ExportAuthConfigsFromDockerCfg() (string, error)

func NarrowAuthSearch

func NarrowAuthSearch(repo string, auths *docker.AuthConfigurations) []docker.AuthConfiguration

NarrowAuthSearch - Narrows down auth search

func NewAuthConfigurations added in v0.4.0

func NewAuthConfigurations(r io.Reader) (*docker.AuthConfigurations, error)

NewAuthConfigurations returns AuthConfigurations from a JSON encoded string in the same format as the .dockercfg file.

func NewAuthConfigurationsFromDockerCfg added in v0.4.0

func NewAuthConfigurationsFromDockerCfg() (*docker.AuthConfigurations, error)

NewAuthConfigurationsFromDockerCfg returns AuthConfigurations from system config files. The following files are checked in the order listed: - $DOCKER_CONFIG/config.json if DOCKER_CONFIG set in the environment, - $HOME/.docker/config.json - $HOME/.dockercfg

func NewAuthConfigurationsFromFile added in v0.4.0

func NewAuthConfigurationsFromFile(path string) (*docker.AuthConfigurations, error)

NewAuthConfigurationsFromFile returns AuthConfigurations from a path containing JSON in the same format as the .dockercfg file.

func TryImagePull

func TryImagePull(client *docker.Client, image string) error

TryImagePull - Attempts to pull an image

Types

type DockerCommander

type DockerCommander struct {
	Client      *docker.Client
	Container   *docker.Container
	CloseWaiter docker.CloseWaiter
	Options     DockerCommanderOptions
}

DockerCommander - A high level docker interface

func NewCommander

func NewCommander(client *docker.Client, options DockerCommanderOptions) *DockerCommander

func (*DockerCommander) Kill

func (dc *DockerCommander) Kill() error

func (*DockerCommander) SetStdio

func (dc *DockerCommander) SetStdio()

func (*DockerCommander) Start

func (dc *DockerCommander) Start() error

type DockerCommanderOptions

type DockerCommanderOptions struct {
	// The name of the docker container
	Name string

	// The image to use
	Image string

	// Overrides the command
	Cmd string

	// Which ports to bind to the host in the form HOST:CONTAINER
	Ports []string

	// Which ports to expose
	Expose []int

	// Volumes to bind
	Binds []string

	// Named volumes to ensure exist
	EnsureNamedVolumes []string

	// Forces the image to get pulled
	ForcePullImage bool

	// The environment
	Env []string

	// Run the docker container in privileged mode
	Privileged bool

	// Auto remove the docker container when it quits
	AutoRemove bool

	Stdin  bool
	Stdout bool
	Stderr bool

	InputStream  io.Reader
	OutputStream io.Writer
	ErrorStream  io.Writer

	PropagateKillError bool
}

Jump to

Keyboard shortcuts

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