containerruntime

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerRuntime

type ContainerRuntime interface {
	// Ensures that the given Docker network exists.
	CreateNetwork(ctx context.Context, name string)

	// Ensures that the given image is available, respecting the pull policy.
	PullImage(ctx context.Context, ref string, policy ImagePullPolicy)

	// Runs the given container, streaming logs to the stdout and stderr.
	// NOTE : Blocks the current thread.
	RunContainer(ctx context.Context, options RunContainerOptions)

	// Closes connection to the Container Runtime's socket.
	CloseSocketConnection(ctx context.Context)
}

type ImagePullPolicy

type ImagePullPolicy string

ImagePullPolicy controls when container images are pulled from the registry.

const (
	// ImagePullPolicyAlways always pulls the image from the registry.
	ImagePullPolicyAlways ImagePullPolicy = "Always"

	// ImagePullPolicyIfNotPresent pulls the image only if it is not already present locally.
	ImagePullPolicyIfNotPresent ImagePullPolicy = "IfNotPresent"

	// ImagePullPolicyNever never pulls the image; it must already exist locally.
	ImagePullPolicyNever ImagePullPolicy = "Never"
)

type RunContainerOptions

type RunContainerOptions struct {
	Name,
	ImageRef,

	Network string

	Binds map[string]string
	Envs  []string

	Command []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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