dockergoal

package
v0.0.0-...-590a5ef Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package dockergoal is a library to reach a set of container goals. It provides the ability to apply "deltas" in the form of recreating containers as necessary as the goal configuration changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyGraph

func ApplyGraph(docker dockerclient.Client, containers []*Container) error

ApplyGraph creates all the specified containers. It handles links making sure the dependencies are created in the right order.

Types

type Container

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

A Container defines a "desired" container state.

func NewContainer

func NewContainer(options ...ContainerOption) (*Container, error)

NewContainer creates a new desired container state. This is only the desired state, it isn't applied until Apply is called.

func (*Container) Apply

func (c *Container) Apply(docker dockerclient.Client) error

Apply creates the container, possibly removing it as necessary based on the container options that were set.

type ContainerOption

type ContainerOption func(c *Container) error

ContainerOption configure options for a container.

func ContainerAfterCreate

func ContainerAfterCreate(f func(containerID string) error) ContainerOption

ContainerAfterCreate specifies a function which is invoked when a new container is created. It is not called if an existing running container with the desired state was found.

func ContainerAuthConfig

func ContainerAuthConfig(ac *dockerclient.AuthConfig) ContainerOption

ContainerAuthConfig specifies the auth credentials used when pulling an image.

func ContainerConfig

func ContainerConfig(config *dockerclient.ContainerConfig) ContainerOption

ContainerConfig specifies the container configuration.

func ContainerForceRemoveExisting

func ContainerForceRemoveExisting() ContainerOption

ContainerForceRemoveExisting forces removing the existing container if one is found. It does so even if the existing container matches the desired state.

func ContainerHostConfig

func ContainerHostConfig(config *dockerclient.HostConfig) ContainerOption

ContainerHostConfig specifies the container host configuration.

func ContainerName

func ContainerName(name string) ContainerOption

ContainerName configures the name of the container.

func ContainerRemoveExisting

func ContainerRemoveExisting() ContainerOption

ContainerRemoveExisting removes an existing container if necessary. If this is option is not specified, and an existing container with a different configuration exists, it will not be removed and an error will be returned. If this option is specified, the existing container will be removed and a new container will be created.

Jump to

Keyboard shortcuts

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