Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerController ¶ added in v0.2.4
type ContainerController interface {
// RunContainer creates a container, starts it, waits for it to complete, and removes it if requested
RunContainer(ctx context.Context, containerName string, config *container.Config, host *container.HostConfig, showOutput bool) error
// StartContainer runs an existing container or creates a new one if none already exist with the given name. It exists without waiting for the container to exit
StartContainer(ctx context.Context, containerName string, config *container.Config, host *container.HostConfig, showOutput bool) (string, error)
// StopContainer stops a container by the given id
StopContainer(ctx context.Context, id string) error
// StopContainerByName stops a container by the given name
StopContainerByName(ctx context.Context, containerName string) error
// RemoveContainer removes a container by the given id
RemoveContainer(ctx context.Context, id string) error
// RemoveContainerByName removes a container by the given name
RemoveContainerByName(ctx context.Context, containerName string) error
// GetContainerByName gets a container by the given name
GetContainerByName(ctx context.Context, containerName string) (*types.Container, error)
// GenerateContainerName generates a random container name in the format of: dctl-UUID
GenerateContainerName() (name string)
}
type DockerController ¶
type DockerController interface {
ImageController
ContainerController
NetworkController
}
func NewDockerController ¶
func NewDockerController() (DockerController, error)
type ImageController ¶ added in v0.2.4
type ImageController interface {
// BuildImage takes a file path and an image name and builds a Docker image using the Dockerfile in the given directory
BuildImage(ctx context.Context, path, image string) error
// PullImage pulls the given image down from the Docker registry
PullImage(ctx context.Context, image string) error
// TagImage tags an existing image with a new tag
TagImage(ctx context.Context, image string, source, target string) error
// PushImage pushes the given image up to the Docker registry
PushImage(ctx context.Context, image string) error
}
Click to show internal directories.
Click to hide internal directories.