local

package
v0.0.0-...-186f89b Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 27 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBaseImage

func FromBaseImage(name string) func(*imgutil.ImageOptions)

func WithConfig

func WithConfig(c *v1.Config) func(*imgutil.ImageOptions)

func WithCreatedAt

func WithCreatedAt(t time.Time) func(*imgutil.ImageOptions)

func WithDefaultPlatform

func WithDefaultPlatform(p imgutil.Platform) func(*imgutil.ImageOptions)

func WithHistory

func WithHistory() func(*imgutil.ImageOptions)

func WithMediaTypes

func WithMediaTypes(m imgutil.MediaTypes) func(*imgutil.ImageOptions)

func WithPreviousImage

func WithPreviousImage(name string) func(*imgutil.ImageOptions)

Types

type DockerClient

type DockerClient interface {
	ImageHistory(ctx context.Context, image string) ([]image.HistoryResponseItem, error)
	ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
	ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error)
	ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
	ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
	ImageTag(ctx context.Context, image, ref string) error
	Info(ctx context.Context) (system.Info, error)
	ServerVersion(ctx context.Context) (types.Version, error)
}

DockerClient is subset of client.CommonAPIClient required by this package.

type IDIdentifier

type IDIdentifier struct {
	ImageID string
}

func (IDIdentifier) String

func (i IDIdentifier) String() string

type Image

type Image struct {
	*imgutil.CNBImageCore
	// contains filtered or unexported fields
}

Image wraps an imgutil.CNBImageCore and implements the methods needed to complete the imgutil.Image interface.

func NewImage

func NewImage(repoName string, dockerClient DockerClient, ops ...imgutil.ImageOption) (*Image, error)

NewImage returns a new image that can be modified and saved to a docker daemon via a tarball in legacy format.

func (*Image) AddLayer

func (i *Image) AddLayer(path string) error

func (*Image) AddLayerWithDiffID

func (i *Image) AddLayerWithDiffID(path, _ string) error

func (*Image) AddLayerWithDiffIDAndHistory

func (i *Image) AddLayerWithDiffIDAndHistory(path, _ string, history v1.History) error

func (*Image) AddOrReuseLayerWithHistory

func (i *Image) AddOrReuseLayerWithHistory(path string, diffID string, history v1.History) error

func (*Image) Delete

func (i *Image) Delete() error

func (*Image) Found

func (i *Image) Found() bool

func (*Image) GetLayer

func (i *Image) GetLayer(diffID string) (io.ReadCloser, error)

GetLayer returns an io.ReadCloser with uncompressed layer data. The layer will always have data, even if that means downloading ALL the image layers from the daemon.

func (*Image) Identifier

func (i *Image) Identifier() (imgutil.Identifier, error)

func (*Image) Kind

func (i *Image) Kind() string

func (*Image) Name

func (i *Image) Name() string

func (*Image) Rebase

func (i *Image) Rebase(baseTopLayerDiffID string, withNewBase imgutil.Image) error

func (*Image) Rename

func (i *Image) Rename(name string)

func (*Image) Save

func (i *Image) Save(additionalNames ...string) error

func (*Image) SaveAs

func (i *Image) SaveAs(name string, additionalNames ...string) error

func (*Image) SaveFile

func (i *Image) SaveFile() (string, error)

func (*Image) SetOS

func (i *Image) SetOS(osVal string) error

func (*Image) Valid

func (i *Image) Valid() bool

type Store

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

Store provides methods for interacting with a docker daemon in order to save, delete, and report the presence of images, as well as download layers for a given image.

func NewStore

func NewStore(dockerClient DockerClient) *Store

func (*Store) AddLayer

func (s *Store) AddLayer(fromPath string) (v1.Layer, error)

func (*Store) Contains

func (s *Store) Contains(identifier string) bool

func (*Store) Delete

func (s *Store) Delete(identifier string) error

func (*Store) LayerByDiffID

func (s *Store) LayerByDiffID(h v1.Hash) (v1.Layer, error)

func (*Store) Save

func (s *Store) Save(image *Image, withName string, withAdditionalNames ...string) (string, error)

func (*Store) SaveFile

func (s *Store) SaveFile(image *Image, withName string) (string, error)

Jump to

Keyboard shortcuts

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