dctr

package
v0.8.36 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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, cli CLI, 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 CLI added in v0.8.21

type CLI interface {
	Client() Client
	AuthInfo(ctx context.Context, repoInfo *registry.RepositoryInfo, cmdName string) (string, types.RequestPrivilegeFunc, error)
}

func NewCLI added in v0.8.21

func NewCLI(streams genericclioptions.IOStreams) (CLI, error)

type Client

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

	ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error)
	ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
	ContainerRemove(ctx context.Context, id string, options container.RemoveOptions) error
	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.CreateResponse, error)
	ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error

	ServerVersion(ctx context.Context) (types.Version, error)
	Info(ctx context.Context) (system.Info, error)
	NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error
	NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error
}

Docker Container client.

func NewAPIClient added in v0.8.0

func NewAPIClient(streams genericclioptions.IOStreams) (Client, error)

Jump to

Keyboard shortcuts

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