container

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInteractive

func BuildInteractive(rt Runtime, args []string) error

BuildInteractive runs a build command with inherited stdout/stderr.

func Cmd

func Cmd(rt Runtime) string

Cmd returns the raw command name for the runtime.

func ExecInteractive

func ExecInteractive(rt Runtime, args []string) (int, error)

ExecInteractive runs a command with inherited stdio (for interactive use).

func IsAvailable

func IsAvailable(rt Runtime) bool

IsAvailable checks if any container runtime is available and operational.

Types

type Runtime

type Runtime interface {
	Name() string
	Build(ctx context.Context, args []string) error
	Run(ctx context.Context, args []string) (int, error)
	Exec(ctx context.Context, ctr string, args []string) error
	ImageExists(image string) bool
	ImageInspect(image, format string) (string, error)
	ImageRemove(image string) error
	PS(filter, format string) ([]string, error)
	Stop(container string) error
	Remove(container string) error
	NetworkCreate(name string, internal bool) error
	NetworkExists(name string) bool
	NetworkConnect(network, container string) error
	NetworkInspect(name, format string) (string, error)
	IsRootless() bool
}

Runtime is the container runtime interface.

func Detect

func Detect() Runtime

Detect finds and returns a container runtime (podman preferred, docker fallback). Returns nil if none found.

func MustDetect

func MustDetect() Runtime

MustDetect returns a runtime or panics with an error message.

Jump to

Keyboard shortcuts

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