Add support for ImageVolume option in Podman Quadlet

Signed-off-by: MayorFaj <mayorfaj@gmail.com>
This commit is contained in:
MayorFaj 2026-06-16 18:59:23 +01:00
parent 478905f6f9
commit c6e5eb5553
6 changed files with 24 additions and 1 deletions

View file

@ -1,8 +1,12 @@
####> This option file is used in:
####> podman create, run
####> podman podman-container.unit.5.md.in, create, run
####> If file is edited, make sure the changes
####> are applicable to all of those.
<< if is_quadlet >>
### `ImageVolume=mode`
<< else >>
#### **--image-volume**=**bind** | *tmpfs* | *ignore*
<< endif >>
Tells Podman how to handle the builtin image volumes. Default is **bind**.

View file

@ -76,6 +76,7 @@ Valid options for `[Container]` are listed below:
| HostName=example.com | --hostname example.com |
| HttpProxy=true | --http-proxy=true |
| Image=ubi8 | Image specification - ubi8 |
| ImageVolume=tmpfs | --image-volume tmpfs |
| IP=192.5.0.1 | --ip 192.5.0.1 |
| IP6=2001:db8::1 | --ip6 2001:db8::1 |
| Label="XYZ" | --label "XYZ" |
@ -222,6 +223,8 @@ Special Cases:
* If the `name` of the image ends with `.image`, Quadlet will use the image pulled by the corresponding `.image` file, and the generated systemd service contains a dependency on the `$name-image.service` (or the service name set in the .image file). Note that the corresponding `.image` file must exist.
* If the `name` of the image ends with `.build`, Quadlet will use the image built by the corresponding `.build` file, and the generated systemd service contains a dependency on the `$name-build.service`. Note: the corresponding `.build` file must exist.
@@option quadlet:image-volume
@@option quadlet:ip
@@option quadlet:ip6

View file

@ -385,6 +385,7 @@ Valid options for `[Container]` are listed below:
| HostName=example.com | --hostname example.com |
| HttpProxy=true | --http-proxy=true |
| Image=ubi8 | Image specification - ubi8 |
| ImageVolume=tmpfs | --image-volume tmpfs |
| IP=192.5.0.1 | --ip 192.5.0.1 |
| IP6=2001:db8::1 | --ip6 2001:db8::1 |
| Label="XYZ" | --label "XYZ" |
@ -721,6 +722,11 @@ Special Cases:
* If the `name` of the image ends with `.image`, Quadlet will use the image pulled by the corresponding `.image` file, and the generated systemd service contains a dependency on the `$name-image.service` (or the service name set in the .image file). Note that the corresponding `.image` file must exist.
* If the `name` of the image ends with `.build`, Quadlet will use the image built by the corresponding `.build` file, and the generated systemd service contains a dependency on the `$name-build.service`. Note: the corresponding `.build` file must exist.
### `ImageVolume=`
Tells Podman how to handle the builtin image volumes. Default is **bind**.
Equivalent to the Podman `--image-volume` option.
### `IP=`
Specify a static IPv4 address for the container, for example **10.88.64.128**.

View file

@ -119,6 +119,7 @@ const (
KeyIgnoreFile = "IgnoreFile"
KeyImage = "Image"
KeyImageTag = "ImageTag"
KeyImageVolume = "ImageVolume"
KeyInterfaceName = "InterfaceName"
KeyInternal = "Internal"
KeyIP = "IP"
@ -289,6 +290,7 @@ var (
KeyIP6: true,
KeyIP: true,
KeyImage: true,
KeyImageVolume: true,
KeyLabel: true,
KeyLogDriver: true,
KeyLogOpt: true,
@ -700,6 +702,7 @@ func ConvertContainer(container *parser.UnitFile, unitsInfoMap map[string]*UnitI
KeyMemory: "--memory",
KeyRetry: "--retry",
KeyRetryDelay: "--retry-delay",
KeyImageVolume: "--image-volume",
}
lookupAndAddString(container, ContainerGroup, stringKeys, podman)

View file

@ -0,0 +1,6 @@
## assert-podman-final-args localhost/imagename
## assert-podman-args --image-volume tmpfs
[Container]
Image=localhost/imagename
ImageVolume=tmpfs

View file

@ -947,6 +947,7 @@ BOGUS=foo
Entry("hostname.container", "hostname.container"),
Entry("idmapping.container", "idmapping.container"),
Entry("image.container", "image.container"),
Entry("image-volume.container", "image-volume.container"),
Entry("install.container", "install.container"),
Entry("ip.container", "ip.container"),
Entry("label.container", "label.container"),