container

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectionFailed = errors.New("Cannot connect to the Docker daemon. Is the docker daemon running on this host?")

ErrConnectionFailed is an error raised when the connection between the client and the server failed.

Functions

func CopyToVolume

func CopyToVolume(docker *client.Docker, file persist.File)

CopyToVolume copies samples into Malice volume

func ErrorConnectionFailed

func ErrorConnectionFailed(host string) error

ErrorConnectionFailed returns an error with host in the error message when connection to docker daemon failed.

func Exists

func Exists(docker *client.Docker, name string) (types.Container, bool, error)

Exists returns APIContainers containers list and true if the container name exists, otherwise false.

func Inspect

func Inspect(docker *client.Docker, id string) (types.ContainerJSON, error)

Inspect returns types.ContainerJSON from Container ID if the container name exists, otherwise false.

func List

func List(docker *client.Docker, all bool) ([]types.Container, error)

List returns array of types.Containers and error

func LogContainer

func LogContainer(docker *client.Docker, contID string)

LogContainer tails container logs to terminal

func Remove

func Remove(docker *client.Docker, contID string, volumes bool, links bool, force bool) error

Remove removes the `cont` container unforcedly. If volumes is true, the associated volumes are removed with container. If links is true, the associated links are removed with container. If force is true, the container will be destroyed with extreme prejudice.

func Run

func Run(
	docker *client.Docker,
	cmd strslice.StrSlice,
	name string,
	image string,
	logs bool,
	binds []string,
	portBindings nat.PortMap,
	links []string,
	env []string,
) error

Run performs a docker run command

func Running

func Running(docker *client.Docker, name string) (types.Container, bool, error)

Running returns APIContainers containers list and true if the container name exists and is running, otherwise false.

func Start

func Start(
	docker *client.Docker,
	cmd strslice.StrSlice,
	name string,
	image string,
	logs bool,
	binds []string,
	portBindings nat.PortMap,
	links []string,
	env []string,
) (types.ContainerJSONBase, error)

Start starts a malice docker container

Types

This section is empty.

Jump to

Keyboard shortcuts

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