runc

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterNamespaces

func FilterNamespaces(ns []specs.LinuxNamespace, types ...specs.LinuxNamespaceType) []specs.LinuxNamespace

Types

type Container

type Container struct {
	ID          string            `json:"id"`
	Pid         int               `json:"pid"`
	Status      string            `json:"status"`
	Bundle      string            `json:"bundle"`
	Rootfs      string            `json:"rootfs"`
	Created     time.Time         `json:"created"`
	Annotations map[string]string `json:"annotations"`
}

type IoOpts

type IoOpts struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

func InheritStdIo

func InheritStdIo() IoOpts

func (IoOpts) WithStdin

func (o IoOpts) WithStdin(reader io.Reader) IoOpts

type Runc

type Runc interface {
	State(ctx context.Context, id string) (*Container, error)
	Spec(ctx context.Context, bundle string) error
	EditSpec(bundle string, editors ...SpecEditor) error
	Run(ctx context.Context, id, bundle string, ioOpts IoOpts) error
	Delete(ctx context.Context, id string, force bool) error
	PrepareBundle(ctx context.Context, image string, id string) (string, func() error, error)
}

func NewRunc

func NewRunc(runtime types.Runtime) Runc

type SpecEditor

type SpecEditor func(spec *specs.Spec)

func WithAnnotations

func WithAnnotations(annotations map[string]string) SpecEditor

func WithCapabilities

func WithCapabilities(caps ...string) SpecEditor

func WithCgroupPath

func WithCgroupPath(cgroupPath, child string) SpecEditor

func WithHostname added in v1.0.1

func WithHostname(hostname string) SpecEditor

func WithMountIfNotPresent

func WithMountIfNotPresent(mount specs.Mount) SpecEditor

func WithNamespaces

func WithNamespaces(ns []specs.LinuxNamespace) SpecEditor

func WithProcessArgs

func WithProcessArgs(args ...string) SpecEditor

func WithProcessCwd

func WithProcessCwd(cwd string) SpecEditor

func WithSelectedNamespaces

func WithSelectedNamespaces(ns []specs.LinuxNamespace, filter ...specs.LinuxNamespaceType) SpecEditor

Jump to

Keyboard shortcuts

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