Documentation ¶
Overview ¶
Package ociimage provides functions related to retrieving and manipulating OCI images, used in pull/push and build operations.
Index ¶
- func CacheReference(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, ...) (types.ImageReference, digest.Digest, error)
- func CachedReferenceFromURI(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, ...) (types.ImageReference, digest.Digest, error)
- func CheckPerms(rootfs string) (err error)
- func FetchLayout(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, ...) (types.ImageReference, digest.Digest, error)
- func FixPerms(rootfs string) (err error)
- func ImageDigest(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, ...) (digest.Digest, error)
- func ParseImageRef(imageRef string) (types.ImageReference, error)
- func UnpackRootfs(ctx context.Context, layoutDir string, manifest imgspecv1.Manifest, ...) (err error)
- type CachedImageReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheReference ¶
func CacheReference(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, src types.ImageReference) (types.ImageReference, digest.Digest, error)
CacheReference converts an ImageReference into a CachedImageReference to cache its blobs.
func CachedReferenceFromURI ¶
func CachedReferenceFromURI(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, uri string) (types.ImageReference, digest.Digest, error)
CachedReferenceFromURI parses a uri-like reference to an OCI image (e.g. docker://ubuntu) into it's transport:reference combination and then returns a CachedImageReference.
func CheckPerms ¶
CheckPerms will work through the rootfs of this bundle, and find if any directory does not have owner rwX - which may cause unexpected issues for a user trying to look through, or delete a sandbox
func FetchLayout ¶
func FetchLayout(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, imageRef, layoutDir string) (types.ImageReference, digest.Digest, error)
FetchLayout will fetch the OCI image specified by imageRef to a containers/image OCI layout in layoutDir. An ImageReference to the image that was fetched into layoutDir is returned on success. If imgCache is non-nil, and enabled, the image will be pulled through the cache.
func FixPerms ¶
FixPerms will work through the rootfs of this bundle, making sure that all files and directories have permissions set such that the owner can read, modify, delete. This brings us to the situation of <=3.4
func ImageDigest ¶
func ImageDigest(ctx context.Context, sysCtx *types.SystemContext, imgCache *cache.Handle, ref types.ImageReference) (digest.Digest, error)
ImageDigest obtains the digest of the image manifest for an ImageReference. If the ImageReference points at a multi-arch repository with an image index (manifest list), it will traverse this to retrieve the digest of the image manifest for the requested architecture specified in sysCtx.
func ParseImageRef ¶
func ParseImageRef(imageRef string) (types.ImageReference, error)
parseImageRef parses a uri-like OCI image reference into a containers/image types.ImageReference.
Types ¶
type CachedImageReference ¶
type CachedImageReference struct { types.ImageReference // contains filtered or unexported fields }
CachedImageReference wraps the containers/image ImageReference type, so that operations pull through a layout holding a cache of OCI blobs.
func (*CachedImageReference) NewImage ¶
func (t *CachedImageReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error)
NewImage wraps the cache's oci-layout ref to first download the real source image to the cache
func (*CachedImageReference) NewImageSource ¶
func (t *CachedImageReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error)
NewImageSource wraps the cache's oci-layout ref to first download the real source image to the cache