rootless

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package rootless implements a daemon-free container runtime for YAP using go-containerregistry for image pulls and rootlesskit for isolated execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybeRunAsChild

func MaybeRunAsChild()

MaybeRunAsChild checks whether the current process was re-executed as the rootlesskit child. If so, it completes the child initialisation and runs the target command inside the new user namespace, then exits.

Call this as early as possible in main(), before cobra runs.

func PullImage

func PullImage(distro string) error

PullImage pulls the YAP builder image for distro from the registry (no CLI required) and extracts it to a local rootfs directory.

func RootfsDir

func RootfsDir(distro string) (string, error)

RootfsDir returns the path to the extracted rootfs for distro.

func RootfsExists

func RootfsExists(distro string) (bool, error)

RootfsExists returns true if a rootfs has already been extracted for distro.

func RunInRootless

func RunInRootless(distro, workDir string, args []string) error

RunInRootless runs args inside the distro rootfs using rootlesskit for user-namespace isolation. workDir is bind-mounted as /workspace.

Types

type Runtime

type Runtime struct{}

Runtime implements the container.Runtime interface using in-process image pull and rootlesskit for user-namespace isolation.

func NewRuntime

func NewRuntime() *Runtime

NewRuntime returns a new rootless Runtime.

func (*Runtime) Pull

func (r *Runtime) Pull(distro string) error

Pull downloads and extracts the YAP builder image for distro.

func (*Runtime) Run

func (r *Runtime) Run(distro, workDir string, args []string) error

Run executes args inside the distro rootfs with workDir bind-mounted as /workspace.

func (*Runtime) RunShell

func (r *Runtime) RunShell(distro, workDir, shellCmd string) error

RunShell executes a shell command string inside the distro rootfs.

func (*Runtime) Type

func (r *Runtime) Type() runtimetype.RuntimeType

Type returns the runtime type identifier.

Jump to

Keyboard shortcuts

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