podman icon indicating copy to clipboard operation
podman copied to clipboard

Support `volume-driver=` options in `mount type=volume`

Open ajoshua2004 opened this issue 3 weeks ago • 1 comments

Feature request description

Docker lets you pick a volume driver for each mount with --mount type=volume,src=myvol,dst=/data,volume-driver=<driver>. Over the API, this is Mounts[].VolumeOptions.DriverConfig.Name. Podman doesn't support the volume-driver option in --mount type=volume right now, so you can't choose a driver for a volume defined with --mount.

This came up in #30105. That PR adds a warning when a container-wide VolumeDriver (HostConfig.VolumeDriver / --volume-driver) is set alongside type=volume mounts. Docker ignores the container-wide driver for volumes given through --mount. To stay in sync with Docker, the warning keeps Moby's text, which tells users to use --mount type=volume,volume-driver=... instead. Podman doesn't support that syntax yet, so the warning currently points users at something they can't use.

Suggest potential solution

Accept volume-driver=<name> in --mount type=volume parsing for the CLI (podman run/create). When the named volume doesn’t exist, use that driver to create it.

In the compat API, honor Mounts[].VolumeOptions.DriverConfig.Name, and possibly DriverConfig.Options, when creating the volume.

Optionally also support volume-opt=<key>=<value> for parity with Docker.

Have you considered any alternatives?

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

ajoshua2004 avatar Nov 06 '26 18:11 ajoshua2004

/assign

Garvity avatar Nov 10 '26 06:11 Garvity