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 ¶
- func ApplyGraph(docker dockerclient.Client, containers []*Container) error
- type Container
- type ContainerOption
- func ContainerAfterCreate(f func(containerID string) error) ContainerOption
- func ContainerAuthConfig(ac *dockerclient.AuthConfig) ContainerOption
- func ContainerConfig(config *dockerclient.ContainerConfig) ContainerOption
- func ContainerForceRemoveExisting() ContainerOption
- func ContainerHostConfig(config *dockerclient.HostConfig) ContainerOption
- func ContainerName(name string) ContainerOption
- func ContainerRemoveExisting() ContainerOption
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.
type ContainerOption ¶
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.