docker

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerController

type DockerController 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
	// 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)
}

func NewDockerController

func NewDockerController() (DockerController, error)

Jump to

Keyboard shortcuts

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