libtc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBundleSpec added in v0.2.2

func AddBundleSpec(s *specs.Spec, bp *prefab.Blueprint, rootfs string) (err error)

func DefaultRuntimeSpec

func DefaultRuntimeSpec() (s *specs.Spec)

These default spec settings are copied from https://github.com/containerd/containerd/tree/main/pkg/oci

func NewCNI

func NewCNI(containerID string, pid int, portMapping string) (*cni, error)

func RootPath

func RootPath(root, path string) (string, error)

RootPath joins a path with a root, evaluating and bounding any symlink to the root directory.

func RunBundle added in v0.2.2

func RunBundle(ctx context.Context, cfg TaskCRunConfig) (err error)

func SetupIO

func SetupIO(process *libcontainer.Process) (*tty, error)

func WithAdditionalGIDs

func WithAdditionalGIDs(s *specs.Spec, userstr string, root string) error

WithAdditionalGIDs sets the OCI spec's additionalGids array to any additional groups listed for a particular user in the /etc/group file of the image's root filesystem The passed in user can be either a uid or a username.

func WithUser

func WithUser(s *specs.Spec, userstr string, root string) (err error)

WithUser sets the user to be used within the container. It accepts a valid user string in OCI Image Spec v1.0.0:

user, uid, user:group, uid:gid, uid:group, user:gid

Types

type Group

type Group struct {
	Name string
	Gid  int
	List []string
}

type TaskCRunConfig

type TaskCRunConfig struct {
	WorkDir     string
	Blueprint   *prefab.Blueprint
	RootFS      string
	Interactive bool
	GPUEnabled  bool
	PortMapping string
	CPULimit    string
	MemoryLimit string
	Input       io.Reader
	Output      io.Writer
}

type User

type User struct {
	Name string
	Uid  int
	Gid  int
}

Jump to

Keyboard shortcuts

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