Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/podman-ts/llms.txt
Use this file to discover all available pages before exploring further.
VolumesManager is the interface for managing Podman volumes. Access it via client.volumes on any PodmanClient instance. Volumes provide persistent, named storage that outlives individual containers and can be shared across them.
VolumesManager methods
list
Key/value filters applied server-side. Common keys include
name, driver, and label.create
Volume instance. If name is omitted, Podman generates one.
Volume name. If omitted, Podman assigns a random name.
Volume driver to use (e.g.
"local"). Defaults to the daemon’s default driver.Driver-specific options passed through to the selected driver.
Labels to attach to the volume.
get
NotFound if the volume does not exist.
exists
true if a volume with the given name exists, false otherwise.
remove
Remove the volume even if it is in use by a container.
prune
{ label: "env=dev" }). Returns a summary of removed volumes and reclaimed disk space.
prune() is irreversible. Any data stored in unused volumes will be permanently deleted.Volume instance methods
AVolume object is returned by create(), get(), and list(). It exposes the following methods:
| Method | Signature | Description |
|---|---|---|
inspect | (): Promise<Record<string, unknown>> | Return the full JSON inspect object from the Podman API. |
remove | (options?: { force?: boolean }): Promise<void> | Remove this volume. Pass force: true to remove even if in use. |
reload | (): Promise<void> | Refresh volume.attrs from the API. Throws NotFound if the volume no longer exists. |
export | (): Promise<ArrayBuffer> | Export the volume contents as a tar archive. |
importTar | (data: ArrayBuffer | Uint8Array): Promise<void> | Import volume contents from a tar archive. |
volume.name property returns the volume’s name string. volume.id is an alias for volume.name.
Code examples
Create a named volume
Create a volume with a custom driver and labels
List volumes
Inspect and remove a volume
Removing a volume that is still mounted by a running container will fail unless
force: true is passed.