image

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImageSpec

func AddImageSpec(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 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 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 Image

type Image struct {
	Prefabs      map[string]string // Prefab Name -> Prefab Specifier
	PrefabIndexs map[string]int    // Prefab Name -> PrefabPaths Index
	PrefabPaths  []string
	RuntimeSpec  *specs.Spec
	LocalDir     string
	LocalDirCnt  int
	BlueprintDir string
	Blueprint    *prefab.Blueprint
}

type ImageManager

type ImageManager struct {
	// contains filtered or unexported fields
}

func NewImageManager

func NewImageManager(workDir string, tempDir string, endpoint string) (im *ImageManager, err error)

func (*ImageManager) Assemble

func (im *ImageManager) Assemble(imageID string, blueprintPath string, dctx *dcontext.DeployContext, overwrite bool) (err error)

assemble the blueprint into a given image blueprintPath must be an absoulute path

func (*ImageManager) Delete

func (im *ImageManager) Delete(imageID string) (err error)

func (*ImageManager) Exist

func (im *ImageManager) Exist(imageID string) (exists bool)

func (*ImageManager) Get

func (im *ImageManager) Get(imageID string) (image *Image, err error)

func (*ImageManager) List

func (im *ImageManager) List() (images []string)

func (*ImageManager) Load

func (im *ImageManager) Load(imageID string, imagePath string, dctx *dcontext.DeployContext, overwrite bool) (err error)

func (*ImageManager) Pack

func (im *ImageManager) Pack(blueprintPath string, dstDir string, imageID string) (err error)

func (*ImageManager) Save

func (im *ImageManager) Save(imageID string, dstDir string) (err error)

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