runc

package
v1.1.30 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerBundle added in v1.1.30

type ContainerBundle interface {
	EditSpec(ctx context.Context, editors ...SpecEditor) error
	MountFromProcess(ctx context.Context, fromPid int, fromPath, mountpoint string) error
	CopyFileFromProcess(ctx context.Context, pid int, fromPath, toPath string) error
	Path() string
	ContainerId() string
	Remove() error
}

type ContainerState added in v1.1.25

type ContainerState 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 (IoOpts) WithStdin

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

type Runc

type Runc interface {
	State(ctx context.Context, id string) (*ContainerState, error)
	Create(ctx context.Context, image, id string) (ContainerBundle, error)
	Run(ctx context.Context, container ContainerBundle, ioOpts IoOpts) error
	RunCommand(ctx context.Context, container ContainerBundle) (*exec.Cmd, error)
	Delete(ctx context.Context, id string, force bool) error
	Kill(background context.Context, id string, signal syscall.Signal) 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 WithNamespace added in v1.1.17

func WithNamespace(ns specs.LinuxNamespace) SpecEditor

func WithNamespaces

func WithNamespaces(ns []specs.LinuxNamespace) SpecEditor

func WithProcessArgs

func WithProcessArgs(args ...string) SpecEditor

func WithProcessCwd

func WithProcessCwd(cwd string) SpecEditor

Jump to

Keyboard shortcuts

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