dockerclient

package
v0.0.0-...-8b8e185 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllVolumesMounted

func AllVolumesMounted(containerName, persistenceDir, imageName string, volumes map[string]string) bool

AllVolumesmounted checks that all the volumes defined in an image are appropriately mounted in our central persistence directory

func DockerContainersDirMounted

func DockerContainersDirMounted(binds []string) bool

DockerContainersDirMounted checks that the directory containing logs for each container has been bind-mounted into the container.

func DockerSocketMounted

func DockerSocketMounted(binds []string) bool

DockerSocketMounted checks that the unix socket docker uses to expose its API has been bind-mounted into the container.

func EnvsMatch

func EnvsMatch(env0, env1, fromImage []string) bool

EnvsMatch checks if a running container's environment matches the one defined in a container definition. The variables defined in the container definition are added to those defined in the base image before comparing with those read from the running container.

func GetContainerByName

func GetContainerByName(name string) (docker.APIContainers, error)

GetContainerByName searches for an existing container by name, returning an error if not found.

func InitDockerClient

func InitDockerClient(endpoint string, registryCredentials map[string]config.RegistryCredentials) error

func InspectContainer

func InspectContainer(s string) (*docker.Container, error)

InspectContainer is a simple proxy function that exposes the method of the same name from the instantiated docker client instance.

func InspectImage

func InspectImage(s string) (*docker.Image, error)

InspectImage is a simple proxy function that exposes the method of the same name from the instantiated docker client instance.

func ListContainers

func ListContainers() ([]docker.APIContainers, error)

ListContainers returns a slice containing all existing docker containers on the current host (running or otherwise).

func PortsMatch

func PortsMatch(definedPorts map[int]int, runningPorts map[docker.Port][]docker.PortBinding) bool

PortsMatch checks if a running container's exposed ports (those bound to the host interface) match those defined in a the container definition.

func PullImage

func PullImage(repoTag string) error

PullImage pulls the latest image for the given repotag from a remote registry. Credentials (if provided) are used in all requests to private registries.

func RemoveContainer

func RemoveContainer(c docker.APIContainers) error

RemoveContainer removes a single existing container.

func StartContainer

func StartContainer(name string, repoTag string, env []string, dockerControlEnabled bool, persistenceEnabled bool, portMapping map[int]int, persistenceDir string) error

StartContainer creates and starts a new container for the given container definition. The name and port of the newly running container will be returned along with the definition.

Types

type Env

type Env []string

Env represents a list of key-pair represented in the form KEY=VALUE.

func (*Env) UnmarshalYAML

func (m *Env) UnmarshalYAML(unmarshal func(v interface{}) error) error

UnmarshalYAML converts the YAML map into a slice of strings containing `k=v` pairs.

Jump to

Keyboard shortcuts

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