Merge pull request #28980 from stefan8/fix/image-volume-default-anonymous

docs: fix --image-volume default and accepted values
This commit is contained in:
Paul Holzinger 2026-08-03 18:56:39 +02:00 committed by GitHub
commit 67aa9604b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 7 deletions

View file

@ -1151,9 +1151,9 @@ func AutocompleteCgroupMode(_ *cobra.Command, _ []string, _ string) ([]string, c
}
// AutocompleteImageVolume - Autocomplete image volume options.
// -> "bind", "tmpfs", "ignore"
// -> "anonymous", "tmpfs", "ignore"
func AutocompleteImageVolume(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
imageVolumes := []string{"bind", "tmpfs", "ignore"}
imageVolumes := []string{"anonymous", "tmpfs", "ignore"}
return imageVolumes, cobra.ShellCompDirectiveNoFileComp
}

View file

@ -174,7 +174,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
imageVolumeFlagName := "image-volume"
createFlags.String(
imageVolumeFlagName, cf.ImageVolume,
`Tells podman how to handle the builtin image volumes ("bind"|"tmpfs"|"ignore")`,
`Tells podman how to handle the builtin image volumes ("anonymous"|"tmpfs"|"ignore")`,
)
_ = cmd.RegisterFlagCompletionFunc(imageVolumeFlagName, AutocompleteImageVolume)

View file

@ -243,6 +243,10 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra
logrus.Warnf("The --kernel-memory flag is no longer supported. This flag is a noop.")
}
if c.Flag("image-volume") != nil && c.Flag("image-volume").Changed && c.Flag("image-volume").Value.String() == "bind" {
logrus.Warnf("The --image-volume=bind value is deprecated, use --image-volume=anonymous instead")
}
if cliVals.LogDriver == define.PassthroughLogging {
if term.IsTerminal(0) || term.IsTerminal(1) || term.IsTerminal(2) {
return vals, errors.New("the '--log-driver passthrough' option cannot be used on a TTY. If you really want it, use '--log-driver passthrough-tty'")

View file

@ -5,12 +5,14 @@
<< if is_quadlet >>
### `ImageVolume=mode`
<< else >>
#### **--image-volume**=**bind** | *tmpfs* | *ignore*
#### **--image-volume**=**anonymous** | *tmpfs* | *ignore*
<< endif >>
Tells Podman how to handle the builtin image volumes. Default is **bind**.
Tells Podman how to handle the builtin image volumes. Default is **anonymous**.
- **bind**: An anonymous named volume is created and mounted into the container.
- **anonymous**: An anonymous named volume is created and mounted into the container.
- **tmpfs**: The volume is mounted onto the container as a tmpfs, which allows the users to create
content that disappears when the container is stopped.
- **ignore**: All volumes are just ignored and no action is taken.
In the past, a **bind** option was accepted as well. This is deprecated, and currently aliased to **anonymous**.

View file

@ -724,7 +724,8 @@ Special Cases:
### `ImageVolume=`
Tells Podman how to handle the builtin image volumes. Default is **bind**.
Tells Podman how to handle the builtin image volumes. Default is **anonymous**.
In the past, a **bind** option was accepted as well. This is deprecated, and currently aliased to **anonymous**.
Equivalent to the Podman `--image-volume` option.
### `IP=`