Documentation
¶
Overview ¶
Package container provides an abstraction layer for container runtimes, allowing YAP to operate with podman, docker, or a built-in rootless runner.
Index ¶
Constants ¶
View Source
const ( // RuntimeCLI uses the system podman or docker CLI. RuntimeCLI = runtimetype.CLI // RuntimeRootless uses the built-in rootless runner (go-containerregistry + rootlesskit). RuntimeRootless = runtimetype.Rootless )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime interface {
// Pull downloads the container image for the given distribution tag.
Pull(distro string) error
// Run executes the given command inside the distro container, mounting
// workDir as /workspace inside the container.
// args are passed directly to the container ENTRYPOINT.
Run(distro, workDir string, args []string) error
// RunShell executes a shell command string inside the distro container,
// overriding the ENTRYPOINT with /bin/sh -c. Use this to chain multiple
// yap sub-commands in a single container invocation.
RunShell(distro, workDir, shellCmd string) error
// Type returns the runtime identifier.
Type() RuntimeType
}
Runtime is the interface every container backend must satisfy.
func Detect ¶
Detect returns the best available Runtime. Priority: podman → docker → built-in rootless. Pass override = "" to use auto-detection; pass "cli" or "rootless" to force.
func NewRootlessRuntime ¶
NewRootlessRuntime returns the built-in rootless Runtime (Linux only).
type RuntimeType ¶
type RuntimeType = runtimetype.RuntimeType
RuntimeType identifies which container backend is in use.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
runtimetype
Package runtimetype defines the RuntimeType enum shared between the container package and its sub-packages to avoid import cycles.
|
Package runtimetype defines the RuntimeType enum shared between the container package and its sub-packages to avoid import cycles. |
|
Package rootless implements a daemon-free container runtime for YAP using go-containerregistry for image pulls and rootlesskit for isolated execution.
|
Package rootless implements a daemon-free container runtime for YAP using go-containerregistry for image pulls and rootlesskit for isolated execution. |
Click to show internal directories.
Click to hide internal directories.