containerutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/somebody/.local/bin"
View Source
const DefaultUsername = "somebody"
View Source
const MagicImageScratch = "scratch"

Variables

This section is empty.

Functions

func Get added in v0.3.2

func Get(ctx context.Context, ref string) (v1.Image, error)

func NewLayer

func NewLayer(ctx context.Context, fs fullfs.FullFS, platform *v1.Platform) (v1.Layer, error)

func NormaliseImage added in v0.3.2

func NormaliseImage(ctx context.Context, base v1.Image) (v1.Image, error)

NormaliseImage mutates the provided v1.Image to be OCI compliant v1.Image.

Check image-spec to see which properties are ported and which are dropped. https://github.com/opencontainers/image-spec/blob/main/config.md

func Pull

func Pull(ctx context.Context, ref string) (v1.Image, error)

func Push

func Push(ctx context.Context, img v1.Image, dst string) error

func Save

func Save(ctx context.Context, img v1.Image, dst, path string) error

Types

type Image

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

func NewImage

func NewImage(opts ...ImageOption) *Image

func (*Image) Append

func (ib *Image) Append(ctx context.Context, fs fs.FullFS, platform *v1.Platform) (v1.Image, error)

type ImageOption

type ImageOption func(image *Image)

func WithBaseImage

func WithBaseImage(img v1.Image) ImageOption

func WithEntrypoint

func WithEntrypoint(ep, cmd []string) ImageOption

func WithEnv

func WithEnv(env ...string) ImageOption

func WithUsername

func WithUsername(s string) ImageOption

Jump to

Keyboard shortcuts

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