dockerutil

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureImage

func EnsureImage(ctx context.Context, cli *client.Client, imageRef string) error

EnsureImage pulls imageRef when it is not already present on the daemon.

func Exec

func Exec(ctx context.Context, cli *client.Client, req ExecRequest) error

Exec runs cmd inside an existing container through the Docker SDK.

func NewClient

func NewClient(ctx context.Context, configuredHost string) (*client.Client, string, error)

NewClient resolves a reachable Docker-compatible daemon and returns a client configured for it.

func RunContainer

func RunContainer(ctx context.Context, cli *client.Client, req RunRequest) error

RunContainer runs a short-lived helper container and removes it afterwards. On failure it includes captured container output in the returned error.

Types

type ExecRequest added in v0.3.2

type ExecRequest struct {
	ContainerID string
	Command     []string
	Stdin       io.Reader
}

ExecRequest describes a command execution inside a running container.

type RunRequest added in v0.3.2

type RunRequest struct {
	Config        *container.Config
	HostConfig    *container.HostConfig
	NetworkConfig *network.NetworkingConfig
	Name          string
	Stdin         io.Reader
}

RunRequest describes a short-lived helper container execution.

Jump to

Keyboard shortcuts

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