mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Document --volume from podman-remote run/create client
[NO TESTS NEEDED] This PR is mainly documentation and some code cleanup. Also cleanup and consolidate handling of other hanlding of podman-remote hidden options. Fixes: https://github.com/containers/podman/issues/9874 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -765,11 +765,15 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) {
|
|||||||
)
|
)
|
||||||
_ = cmd.RegisterFlagCompletionFunc(mountFlagName, AutocompleteMountFlag)
|
_ = cmd.RegisterFlagCompletionFunc(mountFlagName, AutocompleteMountFlag)
|
||||||
|
|
||||||
|
volumeDesciption := "Bind mount a volume into the container"
|
||||||
|
if registry.IsRemote() {
|
||||||
|
volumeDesciption = "Bind mount a volume into the container. Volume src will be on the server machine, not the client"
|
||||||
|
}
|
||||||
volumeFlagName := "volume"
|
volumeFlagName := "volume"
|
||||||
createFlags.StringArrayVarP(
|
createFlags.StringArrayVarP(
|
||||||
&cf.Volume,
|
&cf.Volume,
|
||||||
volumeFlagName, "v", volumes(),
|
volumeFlagName, "v", volumes(),
|
||||||
"Bind mount a volume into the container",
|
volumeDesciption,
|
||||||
)
|
)
|
||||||
_ = cmd.RegisterFlagCompletionFunc(volumeFlagName, AutocompleteVolumeFlag)
|
_ = cmd.RegisterFlagCompletionFunc(volumeFlagName, AutocompleteVolumeFlag)
|
||||||
|
|
||||||
@ -804,4 +808,10 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) {
|
|||||||
"Configure cgroup v2 (key=value)",
|
"Configure cgroup v2 (key=value)",
|
||||||
)
|
)
|
||||||
_ = cmd.RegisterFlagCompletionFunc(cgroupConfFlagName, completion.AutocompleteNone)
|
_ = cmd.RegisterFlagCompletionFunc(cgroupConfFlagName, completion.AutocompleteNone)
|
||||||
|
|
||||||
|
_ = createFlags.MarkHidden("signature-policy")
|
||||||
|
if registry.IsRemote() {
|
||||||
|
_ = createFlags.MarkHidden("env-host")
|
||||||
|
_ = createFlags.MarkHidden("http-proxy")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,11 +63,6 @@ func createFlags(cmd *cobra.Command) {
|
|||||||
common.DefineNetFlags(cmd)
|
common.DefineNetFlags(cmd)
|
||||||
|
|
||||||
flags.SetNormalizeFunc(utils.AliasFlags)
|
flags.SetNormalizeFunc(utils.AliasFlags)
|
||||||
|
|
||||||
_ = flags.MarkHidden("signature-policy")
|
|
||||||
if registry.IsRemote() {
|
|
||||||
_ = flags.MarkHidden("http-proxy")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -76,13 +76,11 @@ func runFlags(cmd *cobra.Command) {
|
|||||||
detachKeysFlagName := "detach-keys"
|
detachKeysFlagName := "detach-keys"
|
||||||
flags.StringVar(&runOpts.DetachKeys, detachKeysFlagName, containerConfig.DetachKeys(), "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or a comma separated sequence of `ctrl-<value>`, where `<value>` is one of: `a-cf`, `@`, `^`, `[`, `\\`, `]`, `^` or `_`")
|
flags.StringVar(&runOpts.DetachKeys, detachKeysFlagName, containerConfig.DetachKeys(), "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or a comma separated sequence of `ctrl-<value>`, where `<value>` is one of: `a-cf`, `@`, `^`, `[`, `\\`, `]`, `^` or `_`")
|
||||||
_ = cmd.RegisterFlagCompletionFunc(detachKeysFlagName, common.AutocompleteDetachKeys)
|
_ = cmd.RegisterFlagCompletionFunc(detachKeysFlagName, common.AutocompleteDetachKeys)
|
||||||
|
|
||||||
_ = flags.MarkHidden("signature-policy")
|
|
||||||
if registry.IsRemote() {
|
if registry.IsRemote() {
|
||||||
_ = flags.MarkHidden("http-proxy")
|
|
||||||
_ = flags.MarkHidden("preserve-fds")
|
_ = flags.MarkHidden("preserve-fds")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
registry.Commands = append(registry.Commands, registry.CliCommand{
|
registry.Commands = append(registry.Commands, registry.CliCommand{
|
||||||
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
|
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
|
||||||
|
@ -1029,7 +1029,7 @@ Create a bind mount. If you specify, ` -v /HOST-DIR:/CONTAINER-DIR`, Podman
|
|||||||
bind mounts `/HOST-DIR` in the host to `/CONTAINER-DIR` in the Podman
|
bind mounts `/HOST-DIR` in the host to `/CONTAINER-DIR` in the Podman
|
||||||
container. Similarly, `-v SOURCE-VOLUME:/CONTAINER-DIR` will mount the volume
|
container. Similarly, `-v SOURCE-VOLUME:/CONTAINER-DIR` will mount the volume
|
||||||
in the host to the container. If no such named volume exists, Podman will
|
in the host to the container. If no such named volume exists, Podman will
|
||||||
create one. The `OPTIONS` are a comma delimited list and can be: <sup>[[1]](#Footnote1)</sup>
|
create one. The `OPTIONS` are a comma delimited list and can be: <sup>[[1]](#Footnote1)</sup> (Note when using the remote client, the volumes will be mounted from the remote server, not necessarly the client machine.)
|
||||||
|
|
||||||
The _options_ is a comma delimited list and can be:
|
The _options_ is a comma delimited list and can be:
|
||||||
|
|
||||||
|
@ -744,7 +744,7 @@ If a container is run within a pod, and the pod has an infra-container, the infr
|
|||||||
#### **\-\-preserve-fds**=*N*
|
#### **\-\-preserve-fds**=*N*
|
||||||
|
|
||||||
Pass down to the process N additional file descriptors (in addition to 0, 1, 2).
|
Pass down to the process N additional file descriptors (in addition to 0, 1, 2).
|
||||||
The total FDs will be 3+N.
|
The total FDs will be 3+N. (This option is not available with the remote Podman client)
|
||||||
|
|
||||||
#### **\-\-privileged**=**true**|**false**
|
#### **\-\-privileged**=**true**|**false**
|
||||||
|
|
||||||
@ -1104,7 +1104,7 @@ Create a bind mount. If you specify _/HOST-DIR_:_/CONTAINER-DIR_, Podman
|
|||||||
bind mounts _host-dir_ in the host to _CONTAINER-DIR_ in the Podman
|
bind mounts _host-dir_ in the host to _CONTAINER-DIR_ in the Podman
|
||||||
container. Similarly, _SOURCE-VOLUME_:_/CONTAINER-DIR_ will mount the volume
|
container. Similarly, _SOURCE-VOLUME_:_/CONTAINER-DIR_ will mount the volume
|
||||||
in the host to the container. If no such named volume exists, Podman will
|
in the host to the container. If no such named volume exists, Podman will
|
||||||
create one.
|
create one. (Note when using the remote client, the volumes will be mounted from the remote server, not necessarly the client machine.)
|
||||||
|
|
||||||
The _options_ is a comma delimited list and can be: <sup>[[1]](#Footnote1)</sup>
|
The _options_ is a comma delimited list and can be: <sup>[[1]](#Footnote1)</sup>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user