runc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditSpec

func EditSpec(bundle string, editors ...SpecEditor) error

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 struct {
	Root  string
	Debug bool
}

func NewRunc

func NewRunc(runtime types.Runtime) *Runc

func (*Runc) Delete

func (r *Runc) Delete(ctx context.Context, id string, force bool) error

func (*Runc) PrepareBundle

func (r *Runc) PrepareBundle(ctx context.Context, image string, id string) (string, func() error, error)

func (*Runc) Run

func (r *Runc) Run(ctx context.Context, id, bundle string, ioOpts IoOpts) error

func (*Runc) Spec

func (r *Runc) Spec(ctx context.Context, bundle string) error

func (*Runc) State

func (r *Runc) State(ctx context.Context, id string) (*Container, error)

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