Skip to content

Commit ff175c0

Browse files
committed
doc: add section on container volume management
Since there is no safe way (unique hash/id) to identify unused named volumes, we cannot automate removal of them. Since volume data, when compared to a container image, is quite small, it was decided that we document this instead. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 21256a8 commit ff175c0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

doc/container.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,50 @@ empty: then rsync".
614614
> volume between containers. All the tricks possible with volumes may
615615
> be added in a later release.
616616
617+
### Volume Management
618+
619+
Volumes are persistent storage that survive container restarts and image
620+
upgrades, making them ideal for application data. However, this also means
621+
they **are not automatically removed** when a container is deleted from the
622+
configuration.
623+
624+
This design choice prevents accidental data loss, especially in scenarios
625+
where:
626+
627+
- A container is temporarily removed and re-added with the same name
628+
- A container is replaced with a different configuration but same name
629+
- System upgrades or configuration changes affect container definitions
630+
631+
To clean up unused volumes and reclaim disk space, use the admin-exec
632+
command:
633+
634+
admin@example:/> container prune
635+
Deleted Images
636+
...
637+
Deleted Volumes
638+
ntpd-varlib
639+
system-data
640+
641+
Total reclaimed space: 45.2MB
642+
643+
The `container prune` command safely removes:
644+
645+
- Unused container images
646+
- Volumes not attached to any container (running or stopped)
647+
- Other unused container resources
648+
649+
> [!TIP]
650+
> You can monitor container resource usage with the command:
651+
>
652+
> admin@example:/> show container usage
653+
>
654+
> This displays disk space used by images, containers, and volumes,
655+
> helping you decide when to run the prune command.
656+
>
657+
> To see which volumes exist and which containers use them:
658+
>
659+
> admin@example:/> show container volumes
660+
617661
### Content Mounts
618662

619663
Content mounts are a special type of file mount where the file contents

0 commit comments

Comments
 (0)