docker

package
Version: v1.34.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 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)

	// Pull the specified container image. Returns output in case the run was successful.
	// Any occurring error is also returned.
	Pull(image string) (string, error)

	// Runs the specified container. Returns true in case the run was successful, false otherwise.
	// Any occurring error is also returned.
	Run(options string, container string) (bool, 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)

	// Create creates the container with specified image. Returns output string in case the creation was successful.
	// Any occurring error is also returned.
	Create(options string, image string) (string, error)

	// CpToContainer 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.
	CpToContainer(source string, container string, target string) error

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

	// Rm removes a specified container from the Docker host.
	// An error indicates that the remove failed.
	Rm(container string) error

	// GetID return the ID of the container for a given label which is present
	// Any occurring error is also returned.
	GetID(container string) (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)

	// IsImageExist provide a bool value if an image exist.
	// Any occurring error is also returned.
	IsImageExist(image string) (bool, 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) CpToContainer added in v1.18.0

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

func (VmDockerCommander) Create added in v1.18.0

func (c VmDockerCommander) Create(options string, image string) (string, error)

func (VmDockerCommander) Exec

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

func (VmDockerCommander) GetID added in v1.19.0

func (c VmDockerCommander) GetID(label string) (string, error)

func (VmDockerCommander) IsImageExist added in v1.21.0

func (c VmDockerCommander) IsImageExist(image string) (bool, error)

func (VmDockerCommander) LocalExec

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

func (VmDockerCommander) Ps

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

func (VmDockerCommander) Pull added in v1.21.0

func (c VmDockerCommander) Pull(image string) (string, error)

func (VmDockerCommander) Restart

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

func (VmDockerCommander) Rm added in v1.18.0

func (c VmDockerCommander) Rm(container string) error

func (VmDockerCommander) Run added in v1.16.0

func (c VmDockerCommander) Run(options string, 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)

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL