Skip to main content
Inspect and manage the local OCI image cache.

Image

Image.get()

Fetch one cached image by reference. Throws an image-not-found error when the reference is not present in the local cache.

Image.list()

Return every cached image.

Image.inspect()

Return full detail for a cached image: handle metadata, parsed OCI config fields, and layer metadata.

Image.remove()

Delete a cached image. When force is not set, an image still referenced by one or more sandboxes causes the call to fail.

Image.prune()


Image.load()

staticasync
Import images from a local archive into the cache. Accepts docker save tarballs and OCI Image Layout archives, so locally built images can be used without going through a registry. tag applies an extra reference to the first image in the archive. Returns a handle for every image reference imported.

Image.save()

staticasync
Export one or more cached images to an archive file. format selects the archive layout: "docker" (default, loadable with docker load) or "oci" (OCI Image Layout). Throws ImageNotFoundError when any reference is not in the local cache.

Types

ImageHandle

class

Returned by get() · list() · load()

A lightweight metadata handle for a cached OCI image. Properties are read-only.

ImageDetail

Returned by inspect()

Full detail for a cached image.

ImageConfigDetail

Used by ImageDetail.config

OCI image config fields extracted from the local cache.

ImageLayerDetail

Used by ImageDetail.layers

Metadata for one image layer.

ImagePruneReport

Returned by prune()

Summary of cached image data removed by Image.prune().