docker

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerCommander

type DockerCommander interface {
	// Ps returns the running containers of the Docker daemon and any error which occurred.
	Ps() (string, error)

	// Status returns the Docker status (via docker inspect) of the specified container. If the container
	// does not exist an error is returned. The valid status types are: created, restarting, running, paused
	// and exited. See also https://docs.docker.com/engine/api/v1.21/
	Status(container string) (string, error)

	// Starts the specified container. Returns true in case the start was successful, false otherwise.
	// Any occurring error is also returned.
	Start(container string) (bool, error)

	// Stops the specified container. Returns true in case the restart was successful, false otherwise.
	// Any occurring error is also returned.
	Stop(container string) (bool, error)

	// Restart restarts the specified container. Returns true in case the restart was successful, false otherwise.
	// Any occurring error is also returned.
	Restart(container string) (bool, error)

	// Cp copies a file from the Docker host to the specified destination in the specified container.
	// A successful copy will return nil. An error indicates that the copy failed.
	Cp(source string, container string, target string) error

	// Exec runs 'docker exec' with the specified options, against the specified container, using the specified
	// command and arguments. The output of the command is returned as well as any occurring error.
	Exec(options string, container string, command string, args string) (string, error)

	// LocalExec runs the specified command on the Docker host
	LocalExec(cmd string) (string, error)
}

type SSHDockerCommander

type SSHDockerCommander interface {
	DockerCommander
	provision.SSHCommander
}

SSHDockerCommander is a DockerCommander which communicates over ssh with a Docker daemon

type VmDockerCommander

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

VmDockerCommander allows to communicate with the Docker daemon w/i the VM

func NewVmDockerCommander

func NewVmDockerCommander(sshCommander provision.SSHCommander) *VmDockerCommander

NewVmDockerCommander creates a new instance of a VmDockerCommander

func (VmDockerCommander) Cp

func (c VmDockerCommander) Cp(source string, container string, target string) error

func (VmDockerCommander) Exec

func (c VmDockerCommander) Exec(options string, container string, command string, args string) (string, error)

func (VmDockerCommander) LocalExec

func (c VmDockerCommander) LocalExec(cmd string) (string, error)

func (VmDockerCommander) Ps

func (c VmDockerCommander) Ps() (string, error)

func (VmDockerCommander) Restart

func (c VmDockerCommander) Restart(container string) (bool, error)

func (VmDockerCommander) Start

func (c VmDockerCommander) Start(container string) (bool, error)

func (VmDockerCommander) Status

func (c VmDockerCommander) Status(container string) (string, error)

func (VmDockerCommander) Stop

func (c VmDockerCommander) Stop(container string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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