containerruntime

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package containerruntime resolves the local container runtime (docker or podman) and executes its CLI. Shared by pkg/controlplane and pkg/discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect() (Kind, Runner)

Detect resolves from DASH_CONTAINER_RUNTIME + PATH. Runner is nil when Kind is None.

Types

type Kind

type Kind string

Kind identifies the resolved container runtime.

const (
	Docker Kind = "docker"
	Podman Kind = "podman"
	None   Kind = ""
)

func Resolve

func Resolve(env string, look func(string) (string, error)) Kind

Resolve picks the container runtime: an explicit valid env override, else docker (preferred) then podman via look, else None.

type Runner

type Runner interface {
	Run(ctx context.Context, args ...string) ([]byte, error)
	Stream(ctx context.Context, args ...string) (<-chan string, error)
}

Runner executes runtime subcommands: Run returns stdout; Stream emits lines.

func NewExecRunner

func NewExecRunner(kind Kind) Runner

NewExecRunner returns a Runner invoking the kind's CLI binary.

Jump to

Keyboard shortcuts

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