docker

package
v0.0.0-...-f4175bf Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerApi

type DockerApi interface {
	ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
	ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error
	ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error
	ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
	ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.ContainerCreateCreatedBody, error)
}

type DockerClient

type DockerClient interface {
	// GetContainer finds the first container that matches the specified container name.
	// If no match is found, then a nil container and nil error is returned. Note that this function only
	// looks at containers that are in a running state.
	GetContainer(containerName string) (*types.Container, error)
	// Stops and removes the first container that matches the provided container name.
	// If no containers match, nothing happens. If any errors are encountered, they're returned.
	StopAndRemoveContainer(containerName string) error
	// Starts a container with the specified configuration. If any errors are encountered, they are returned.
	StartContainer(imageName string, hostConfig *container.HostConfig, containerConfig *container.Config, containerName string) error
}

func NewDockerClient

func NewDockerClient() (DockerClient, error)

Jump to

Keyboard shortcuts

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