Documentation ¶
Index ¶
- func AllVolumesMounted(containerName, persistenceDir, imageName string, volumes map[string]string) bool
- func DockerContainersDirMounted(binds []string) bool
- func DockerSocketMounted(binds []string) bool
- func EnvsMatch(env0, env1, fromImage []string) bool
- func GetContainerByName(name string) (docker.APIContainers, error)
- func InitDockerClient(endpoint string, registryCredentials map[string]config.RegistryCredentials) error
- func InspectContainer(s string) (*docker.Container, error)
- func InspectImage(s string) (*docker.Image, error)
- func ListContainers() ([]docker.APIContainers, error)
- func PortsMatch(definedPorts map[int]int, runningPorts map[docker.Port][]docker.PortBinding) bool
- func PullImage(repoTag string) error
- func RemoveContainer(c docker.APIContainers) error
- func StartContainer(name string, repoTag string, env []string, dockerControlEnabled bool, ...) error
- type Env
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 ¶
DockerContainersDirMounted checks that the directory containing logs for each container has been bind-mounted into the container.
func DockerSocketMounted ¶
DockerSocketMounted checks that the unix socket docker uses to expose its API has been bind-mounted into the container.
func EnvsMatch ¶
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 ¶
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 ¶
InspectContainer is a simple proxy function that exposes the method of the same name from the instantiated docker client instance.
func InspectImage ¶
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 ¶
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 ¶
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.