Image class and require a local backend; cloud backends report Unsupported.
Static · Image5
Image.get()one cached imageImage.list()all cached imagesImage.inspect()config + layer detailImage.remove()delete a cached imageImage.prune()reclaim unused dataTypes
Typical flow
Static methods
Image.get()
Example
Example
Image.list()
Example
Example
Image.inspect()
Example
Example
Image.remove()
force is not set, an image still referenced by one or more sandboxes causes the call to fail.
Example
Example
Image.prune()
bytesReclaimed is reported when deleted files could be measured.
Example
Example
Types
ImageHandle
A lightweight metadata handle for a cached OCI image. Properties are read-only.| Property | Type | Description |
|---|---|---|
reference | string | Image reference |
sizeBytes | number | null | Total image size in bytes, when known |
manifestDigest | string | null | Content-addressable manifest digest |
architecture | string | null | Resolved architecture |
os | string | null | Resolved operating system |
layerCount | number | Number of layers |
lastUsedAt | Date | null | Last referenced time |
createdAt | Date | null | First-pulled time |
ImageDetail
Returned by inspect()
Full detail for a cached image.| Property | Type | Description |
|---|---|---|
handle | ImageHandle | Core cached image metadata |
config | ImageConfigDetail | null | Parsed OCI config block |
layers | readonly ImageLayerDetail[] | Layers in bottom-to-top order |
ImageConfigDetail
Used by ImageDetail.config
OCI image config fields extracted from the local cache.| Property | Type | Description |
|---|---|---|
digest | string | Config blob digest |
env | readonly string[] | Environment variables in KEY=value form |
cmd | readonly string[] | null | Default command |
entrypoint | readonly string[] | null | Image entrypoint |
workingDir | string | null | Default working directory |
user | string | null | Default user |
labels | Record<string, unknown> | null | OCI labels |
stopSignal | string | null | Configured stop signal |
ImageLayerDetail
Used by ImageDetail.layers
Metadata for one image layer.| Property | Type | Description |
|---|---|---|
diffId | string | Uncompressed diff ID |
blobDigest | string | Compressed blob digest |
mediaType | string | null | OCI media type |
compressedSizeBytes | number | null | Compressed blob size in bytes |
erofsSizeBytes | number | null | EROFS image size in bytes |
position | number | Layer position, where 0 is the bottom |
ImagePruneReport
Returned by prune()
Summary of cached image data removed byImage.prune().
| Property | Type | Description |
|---|---|---|
imageRefsRemoved | number | Cached image references removed from the local image index |
manifestsRemoved | number | OCI manifests removed from the local image index |
layersRemoved | number | Layer records removed from the local image index |
fsmetaRemoved | number | Merged fsmeta EROFS artifacts removed from disk |
vmdkRemoved | number | VMDK descriptor artifacts removed from disk |
bytesReclaimed | number | null | Best-effort measured bytes reclaimed from deleted artifacts |