docker

package
v0.0.0-...-6dffcca Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDocker

func CheckDocker() error

CheckDocker verifies that docker-machine is installed and runnable.

func CheckDockerMachine

func CheckDockerMachine() error

CheckDockerMachine verifies that docker-machine is installed and runnable.

func CreateMachine

func CreateMachine(driver drivers.Driver, name string) error

CreateMachine creates a new docker machine using the passed-in driver and name.

func GetDockerFlags

func GetDockerFlags(name string) ([]string, error)

GetDockerFlags returns the list of flags we need to pass to docker to talk to the given machine's docker daemon. We expect a single line, but then split that line into individual flags.

func GetHostConfig

func GetHostConfig(name string, config *drivers.HostConfig) error

GetHostConfig gets the machine config from docker-machine. It takes an initialized driver.HostConfig struct with the Driver field initialized to the driver-specific type. The passed-in object is filled in with the contents of the config.

func GetLargestNodeIndex

func GetLargestNodeIndex(nodes []string) (int, error)

GetLargestNodeIndex takes a list of node names and returns the largest node index seen. Returns 0 if no nodes are passed. Fails on parsing errors.

func ListCockroachNodes

func ListCockroachNodes() ([]string, error)

ListCockroachNodes returns a list of machines that are cockroach nodes. We could use stream with grep, but let's minimize our dependencies. docker-machine is also terrible at proper exit codes.

func ListMachines

func ListMachines() ([]string, error)

ListMachines returns a list of machine names.

func MakeNodeName

func MakeNodeName(id int) string

MakeNodeName generates a cockroach node name for the given ID.

func RunDockerInit

func RunDockerInit(driver drivers.Driver, nodeName string, settings *drivers.HostConfig) error

RunDockerInit initializes the first node.

func RunDockerStart

func RunDockerStart(driver drivers.Driver, nodeName string, settings *drivers.HostConfig) error

RunDockerStart starts the cockroach binary.

func StartMachine

func StartMachine(name string) error

StartMachine invokes "docker-machine start" on the given machine name.

func StopMachine

func StopMachine(name string) error

StopMachine invokes "docker-machine stop" on the given machine name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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