dctr

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIClient added in v0.8.0

func NewAPIClient(streams genericclioptions.IOStreams) (client.APIClient, error)

func RemoveIfNecessary

func RemoveIfNecessary(ctx context.Context, c Client, name string) error

A simplified remove-container-if-necessary helper.

func Run

func Run(ctx context.Context, c Client, name string, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig) error

A simplified run-container-and-detach helper for background support containers (like socat and the registry).

Types

type Client

type Client interface {
	DaemonHost() string
	ImagePull(ctx context.Context, image string, options types.ImagePullOptions) (io.ReadCloser, error)

	ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
	ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
	ContainerRemove(ctx context.Context, id string, options types.ContainerRemoveOptions) error
	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error)
	ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
}

Docker Container client.

Jump to

Keyboard shortcuts

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