dockers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthCheckDockerAPI

func HealthCheckDockerAPI() error

HealthCheckDockerAPI returns true if a 200 status code is received from dockerAddress or false otherwise.

Types

type CreateContainerPayload

type CreateContainerPayload struct {
	Image string   `json:"Image"`
	Tty   bool     `json:"Tty,omitempty"`
	Cmd   []string `json:"Cmd"`
}

CreateContainerPayload is a struct that represents all data needed to create a container.

type Docker

type Docker struct {
	CID string `json:"Id"`
	// contains filtered or unexported fields
}

Docker is the docker struct

func NewDocker

func NewDocker() (*Docker, error)

NewDocker returns a new docker.

func (Docker) CreateContainer

func (d Docker) CreateContainer(analysis types.Analysis, image string, cmd string) (string, error)

CreateContainer creates a new container

func (Docker) DieContainers added in v0.3.0

func (d Docker) DieContainers() error

DieContainers stops and removes all containers

func (Docker) ImageIsLoaded

func (d Docker) ImageIsLoaded(image string) bool

ImageIsLoaded returns a bool if a a docker image is loaded or not.

func (Docker) ListImages

func (d Docker) ListImages() ([]dockerTypes.ImageSummary, error)

ListImages returns docker images, like docker image ls.

func (Docker) ListStoppedContainers added in v0.3.0

func (d Docker) ListStoppedContainers() ([]Docker, error)

ListContainers returns a Docker type list with CIDs of stopped containers

func (Docker) PullImage

func (d Docker) PullImage(image string) error

PullImage pulls an image, like docker pull.

func (Docker) ReadOutput

func (d Docker) ReadOutput() (string, error)

ReadOutput returns STDOUT of a given containerID.

func (Docker) ReadOutputStderr

func (d Docker) ReadOutputStderr() (string, error)

ReadOutputStderr returns STDERR of a given containerID.

func (Docker) RemoveContainer added in v0.3.0

func (d Docker) RemoveContainer() error

RemoveContainer removes a container by it's CID

func (Docker) RemoveImage

func (d Docker) RemoveImage(imageID string) ([]dockerTypes.ImageDelete, error)

RemoveImage removes an image.

func (Docker) StartContainer

func (d Docker) StartContainer() error

StartContainer starts a container and returns its error.

func (Docker) StopContainer added in v0.3.0

func (d Docker) StopContainer() error

StopContainer stops an active container by it's CID

func (Docker) WaitContainer

func (d Docker) WaitContainer(timeOutInSeconds int) error

WaitContainer returns when container finishes executing cmd.

Jump to

Keyboard shortcuts

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