Documentation ¶
Index ¶
- func FromBaseImage(name string) func(*imgutil.ImageOptions)
- func WithConfig(c *v1.Config) func(*imgutil.ImageOptions)
- func WithCreatedAt(t time.Time) func(*imgutil.ImageOptions)
- func WithDefaultPlatform(p imgutil.Platform) func(*imgutil.ImageOptions)
- func WithHistory() func(*imgutil.ImageOptions)
- func WithMediaTypes(m imgutil.MediaTypes) func(*imgutil.ImageOptions)
- func WithPreviousImage(name string) func(*imgutil.ImageOptions)
- type DockerClient
- type IDIdentifier
- type Image
- func (i *Image) AddLayer(path string) error
- func (i *Image) AddLayerWithDiffID(path, _ string) error
- func (i *Image) AddLayerWithDiffIDAndHistory(path, _ string, history v1.History) error
- func (i *Image) AddOrReuseLayerWithHistory(path string, diffID string, history v1.History) error
- func (i *Image) Delete() error
- func (i *Image) Found() bool
- func (i *Image) GetLayer(diffID string) (io.ReadCloser, error)
- func (i *Image) Identifier() (imgutil.Identifier, error)
- func (i *Image) Kind() string
- func (i *Image) Name() string
- func (i *Image) Rebase(baseTopLayerDiffID string, withNewBase imgutil.Image) error
- func (i *Image) Rename(name string)
- func (i *Image) Save(additionalNames ...string) error
- func (i *Image) SaveAs(name string, additionalNames ...string) error
- func (i *Image) SaveFile() (string, error)
- func (i *Image) SetOS(osVal string) error
- func (i *Image) Valid() bool
- type Store
- func (s *Store) AddLayer(fromPath string) (v1.Layer, error)
- func (s *Store) Contains(identifier string) bool
- func (s *Store) Delete(identifier string) error
- func (s *Store) LayerByDiffID(h v1.Hash) (v1.Layer, error)
- func (s *Store) Save(image *Image, withName string, withAdditionalNames ...string) (string, error)
- func (s *Store) SaveFile(image *Image, withName string) (string, error)
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) AddLayerWithDiffID ¶
func (*Image) AddLayerWithDiffIDAndHistory ¶
func (*Image) AddOrReuseLayerWithHistory ¶
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)
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
Click to show internal directories.
Click to hide internal directories.