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 ¶
- type Runtime
- func (r *Runtime) Create(ctx context.Context, id, bundleDir string, stdio runtime.Stdio) error
- func (r *Runtime) Delete(ctx context.Context, id string) error
- func (r *Runtime) Kill(ctx context.Context, id, signal string) error
- func (r *Runtime) Name() string
- func (r *Runtime) Start(ctx context.Context, id string) error
- func (r *Runtime) State(ctx context.Context, id string) (string, int, error)
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 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.