crun

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package crun implements runtime.Runtime by exec'ing the `crun` binary. crun is preferred over runc in micro-VM environments because it's a ~500KB static C binary with measurably faster container start (~2× vs runc on cold boot) — important when the VM boot budget is in the hundreds of milliseconds.

The same code works against `runc` by passing a different Binary; surface is identical except for one trivial flag difference that we paper over.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	// Binary is the absolute path of the runtime executable. Defaults
	// to "crun" (PATH lookup) when empty.
	Binary string
	// Root is the runtime state directory (default /run/weft/<binary>).
	Root string
}

Runtime is an OCI runtime invoked as an external binary.

func New

func New() *Runtime

func NewRunc

func NewRunc() *Runtime

NewRunc returns a Runtime configured for the runc binary. Use when you want the all-Go runtime ecosystem at the cost of a small cgo bootstrap in runc itself (the nsenter constructor) ; pair with a runc binary built CGO_ENABLED=1 -tags=. The CLI surface is identical to crun.

func (*Runtime) Create

func (r *Runtime) Create(ctx context.Context, id, bundleDir string, stdio runtime.Stdio) error

func (*Runtime) Delete

func (r *Runtime) Delete(ctx context.Context, id string) error

func (*Runtime) Kill

func (r *Runtime) Kill(ctx context.Context, id, signal string) error

func (*Runtime) Name

func (r *Runtime) Name() string

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, id string) error

func (*Runtime) State

func (r *Runtime) State(ctx context.Context, id string) (string, int, error)

Jump to

Keyboard shortcuts

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