podman volume manages named volumes that persist data independently of any single container.
Named volumes hold data that should outlive a container, like a database in an integration test. podman volume mirrors docker volume.
What it does
podman volume creates, lists, inspects, and removes named volumes. A volume is storage managed by Podman that you mount into containers with -v name:/path, surviving container removal until you delete the volume.
Use a named volume for test data that must persist across container restarts within a job, and podman volume prune -f in cleanup to reclaim space. On SELinux runners add :Z to the volume mount so the container can write to it.
Common errors in CI
"Error: volume ... is being used by the following container(s)" on rm means a container still mounts it; remove the container first or use podman volume rm -f. "Permission denied" writing into a mounted volume on an SELinux host is fixed with the :Z mount option. A volume created by another user is invisible due to the rootless-vs-root store split.
Frequently asked questions
podman volume: Manage Data Volumes?
Named volumes hold data that should outlive a container, like a database in an integration test. podman volume mirrors docker volume.
What it does?
podman volume creates, lists, inspects, and removes named volumes. A volume is storage managed by Podman that you mount into containers with -v name:/path, surviving container removal until you delete the volume.
In CI?
Use a named volume for test data that must persist across container restarts within a job, and podman volume prune -f in cleanup to reclaim space. On SELinux runners add :Z to the volume mount so the container can write to it.
Common errors in CI?
"Error: volume ... is being used by the following container(s)" on rm means a container still mounts it; remove the container first or use podman volume rm -f. "Permission denied" writing into a mounted volume on an SELinux host is fixed with the :Z mount option.