dockerutil

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const NetName = "ddev_default"

NetName provides the default network name for ddev.

Variables

This section is empty.

Functions

func CheckDockerVersion

func CheckDockerVersion(versionConstraint string) error

CheckDockerVersion determines if the docker version of the host system meets the provided version constraints. See https://godoc.org/github.com/Masterminds/semver#hdr-Checking_Version_Constraints for examples defining version constraints.

func ComposeCmd

func ComposeCmd(composeFiles []string, action ...string) error

ComposeCmd executes docker-compose commands via shell.

func ContainerName

func ContainerName(container docker.APIContainers) string

ContainerName returns the containers human readable name.

func ContainerWait

func ContainerWait(timeout time.Duration, labels map[string]string) error

ContainerWait provides a wait loop to check for container in "healthy" status. timeout is in seconds.

func EnsureNetwork

func EnsureNetwork(client *docker.Client, name string) error

EnsureNetwork will ensure the docker network for ddev is created.

func FindContainerByLabels

func FindContainerByLabels(labels map[string]string) (docker.APIContainers, error)

FindContainerByLabels takes a map of label names and values and returns any docker containers which match all labels.

func FindContainersByLabels

func FindContainersByLabels(labels map[string]string) ([]docker.APIContainers, error)

FindContainersByLabels takes a map of label names and values and returns any docker containers which match all labels.

func GetAppContainers

func GetAppContainers(sitename string) ([]docker.APIContainers, error)

GetAppContainers retrieves docker containers for a given sitename.

func GetContainerEnv

func GetContainerEnv(key string, container docker.APIContainers) string

GetContainerEnv returns the value of a given environment variable from a given container.

func GetContainerHealth

func GetContainerHealth(container docker.APIContainers) string

GetContainerHealth retrieves the status of a given container. The status string returned by docker contains uptime and the health status in parenths. This function will filter the uptime and return only the health status.

func GetDockerClient

func GetDockerClient() *docker.Client

GetDockerClient returns a docker client for a docker-machine.

func GetDockerContainers

func GetDockerContainers(allContainers bool) ([]docker.APIContainers, error)

GetDockerContainers returns a slice of all docker containers on the host system.

func GetPublishedPort

func GetPublishedPort(privatePort int64, container docker.APIContainers) int64

GetPublishedPort returns the published port for a given private port.

func NetExists

func NetExists(client *docker.Client, name string) bool

NetExists checks to see if the docker network for ddev exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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