podman-volume.unit(5)
okay so bestie, welcome to podman-volume.unit(5) β it lives in the File Formats Manual section, and it's literally the glow-up guide for systemd unit files that manage container volumes with Podman Quadlet π¦
β¨ NAME β¨
podman-volume.unit β systemd unit files for managing container volumes using Podman Quadlet π
πΈ SYNOPSIS πΈ
name.volume
π DESCRIPTION π
So here's the tea: volume files are named with a .volume extension, and they contain a section called [Volume] that describes the named Podman volume. The generated service is a one-time command that makes sure the volume exists on the host β creating it if needed. Slay, honestly. β¨
By default, the Podman volume has the same name as the unit, but with a systemd- prefix. Like, for a volume file named $NAME.volume, the generated Podman volume is called systemd-$NAME, and the generated service file is $NAME-volume.service. The VolumeName option lets you override this default name with one you provide yourself, no big deal π
Using volume units is lowkey iconic because it lets containers depend on volumes being automatically pre-created. It's especially interesting when you're using special options to control volume creation β because otherwise Podman just creates volumes with the default options, and we don't want that, bestie π
π§ USAGE SUMMARY π§
The .volume file is parsed by the podman-system-generator at boot or reload, generating a systemd .service that runs podman volume create. That's it. That's the whole vibe. π
π OPTIONS π
Valid options for [Volume] are listed below β here's your lil mapping cheat sheet, where each [Volume] option gets matched up with its podman volume create equivalent π«Ά
ContainersConfModule=/etc/nvd.confβ--module=/etc/nvd.confCopy=trueβ--opt copyDevice=tmpfsβ--opt device=tmpfsDriver=imageβ--driver=imageGlobalArgs=--log-level=debugβ--log-level=debugGroup=192β--opt group=192Image=quay.io/centos/centos:latestβ--opt image=quay.io/centos/centos:latestLabel="foo=bar"β--label "foo=bar"Options=XYZβ--opt "o=XYZ"PodmanArgs=--driver=imageβ--driver=imageType=typeβ Filesystem type of DeviceUser=123β--opt uid=123VolumeName=fooβpodman volume create foo
Supported keys in the [Volume] section are:
π ContainersConfModule=module
Load the specified containers.conf(5) module. Fr fr, that's it.
This option can be listed multiple times π«
π Copy=bool (defaults to true)
If enabled, the content of the image located at the mount point of the volume is copied into the volume on the first run. One-time copy, no cap.
π Device=
The path of a device which is mounted for the volume.
π Driver=
Specify the volume driver name. Heads up bestie: when set to image, the Image key must also be set.
This is equivalent to the Podman --driver option.
π GlobalArgs=
This key contains a list of arguments passed directly after the podman command in the generated file. It can be used to access Podman features that are otherwise unsupported by the generator. But likeβ¦ since the generator is unaware of what unexpected interactions can be caused by these arguments, it is not recommended to use this option π
The format of this is a space separated list of arguments, which can optionally be individually escaped to allow inclusion of whitespace and other control characters.
This key can be listed multiple times.
π Group=
The host (numeric) GID, or group name to use as the group for the volume.
π Image=
Specifies the image the volume is based on when Driver is set to image. It is recommended to use a fully qualified image name rather than a short name β both for performance and robustness reasons. Do it, bestie, your future self will thank you π
The format of the name is the same as when passed to podman pull. So, it supports using :tag or digests to guarantee the specific image version. Periodt.
Special case:
- If the name of the image ends with
.image, Quadlet will use the image pulled by the corresponding.imagefile, and the generated systemd service contains a dependency on the$name-image.service(or the service name set in the.imagefile). Note: the corresponding.imagefile must exist.
π Label=
Set one or more OCI labels on the volume. The format is a list of key=value items, similar to Environment.
This key can be listed multiple times.
π Options=
The mount options to use for a filesystem as used by the mount(8) command -o option.
π PodmanArgs=
This key contains a list of arguments passed directly to the end of the podman command in the generated file. It can be used to access Podman features that are otherwise unsupported by the generator. Again though β since the generator is unaware of what unexpected interactions can be caused by these arguments, it is not recommended to use this option π
The format of this is a space separated list of arguments, which can optionally be individually escaped to allow inclusion of whitespace and other control characters.
This key can be listed multiple times.
π Type=
The filesystem type of Device as used by the mount(8) command's -t option.
π User=
The host (numeric) UID, or user name to use as the owner for the volume.
π VolumeName=
The (optional) name of the Podman volume. If this is not specified, the default value is the same name as the unit, but with a systemd- prefix β i.e. a $name.volume file creates a systemd-$name Podman volume, so there's no conflict with user-managed volumes. Clever, right? π
π EXAMPLE π
Minimal volume unit, cute and to the point:
[Volume]
VolumeName=mydata
Label=app=data
User=1000
Group=1000
Volume unit backed by an image β this one's giving main character energy:
[Volume]
VolumeName=html
Driver=image
Image=quay.io/centos/centos:latest
Copy=true
π¦ SEE ALSO π¦
systemd.unit(5), podman-systemd.unit(5), podman-volume-create(1)
and that's the whole page, bestie β mwah π this lil sign-off is brought to you by podman-volume.unit(5), iykyk πβ¨
π¦ where this page comes from
- arch rolling: podman 6.1.4-1 Β· Apache-2.0
- centos-stream 10: podman 7:6.1.0-2.el10 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- nixpkgs unstable: podman 6.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms