Skip to content

Image

A container image.

Fields

architecture @ Str

CPU architecture, such as "amd64".

cmd @ (Array[Str] | nil)

Default command, or nil when unset.

created @ Str

Creation timestamp, as the runtime reports it.

entrypoint @ (Array[Str] | nil)

Entrypoint, or nil when unset.

env @ Dict[Str, Str]

Environment variables.

id @ Str

Full image ID, sha256:....

labels @ (Dict[Str, Str] | nil)

Labels, or nil when the image has none.

layers @ Array[Str]

Layer digests.

os @ Str

Operating system, such as "linux".

size @ Int

Image size in bytes.

user @ (Str | nil)

Default user, or nil when unset.

working_dir @ (fs.Path | nil)

Working directory, or nil when unset.

Methods

remove …

Removes the image.

img.remove()
img.remove force: true

Parameters

NameTypeDescription
:force? Bool Remove the image even if containers use it, removing them too.

save target … -> (Str | fs.Path)

Saves the image to an archive or directory, returning target.

Parameters

NameTypeDescription
target (Str | fs.Path) Archive path or directory to write.
:format? ArchiveFormat Archive format.
:platform? Platform Platform to save.

tag new_tag

Tags the image with a new name.

img.tag "registry.example.com/myapp:v1.2"

Parameters

NameTypeDescription
new_tag Str Reference to tag the image as.

tags() -> Array[ImageTag]

Returns the current tags, which are empty for an untagged image.