dockerhelper

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

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

Helper provides utility functions to help with Docker

func NewHelper

func NewHelper(client *docker.Client, engineAPIClient *dockerclient.Client) *Helper

NewHelper creates a new Helper

func (*Helper) CheckAndPull

func (h *Helper) CheckAndPull(image string, out io.Writer) error

CheckAndPull checks whether a Docker image exists. If not, it pulls it.

func (*Helper) ContainerLog

func (h *Helper) ContainerLog(container string, numLines int) string

func (*Helper) GetContainerState

func (h *Helper) GetContainerState(id string) (exists, running bool, err error)

GetContainerState returns whether a container exists and if it does whether it's running

func (*Helper) HasInsecureRegistryArg

func (h *Helper) HasInsecureRegistryArg() (bool, error)

HasInsecureRegistryArg checks whether the docker daemon is configured with the appropriate insecure registry argument

func (*Helper) HostIP

func (h *Helper) HostIP() string

HostIP returns the IP of the Docker host if connecting via TCP

func (*Helper) ListContainerNames

func (h *Helper) ListContainerNames() ([]string, error)

func (*Helper) RemoveContainer

func (h *Helper) RemoveContainer(id string) error

RemoveContainer removes the container with the given id

func (*Helper) StopAndRemoveContainer

func (h *Helper) StopAndRemoveContainer(container string) error

func (*Helper) Version

func (h *Helper) Version() (*semver.Version, bool, error)

Version returns the Docker version and whether it is a Red Hat distro version

type RegistryConfig

type RegistryConfig struct {
	InsecureRegistryCIDRs []string
}

Jump to

Keyboard shortcuts

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