mirror of https://github.com/docker/cli.git
Merge pull request #26830 from dnephin/man-desc-in-files
Move the command description to a markdown file for man pages
This commit is contained in:
commit
f2cac1b6e8
|
@ -12,7 +12,6 @@ func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "volume COMMAND",
|
||||
Short: "Manage volumes",
|
||||
Long: volumeDescription,
|
||||
Args: cli.NoArgs,
|
||||
RunE: dockerCli.ShowHelp,
|
||||
}
|
||||
|
@ -25,21 +24,3 @@ func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|||
)
|
||||
return cmd
|
||||
}
|
||||
|
||||
var volumeDescription = `
|
||||
The **docker volume** command has subcommands for managing data volumes. A data
|
||||
volume is a specially-designated directory that by-passes storage driver
|
||||
management.
|
||||
|
||||
Data volumes persist data independent of a container's life cycle. When you
|
||||
delete a container, the Docker daemon does not delete any data volumes. You can
|
||||
share volumes across multiple containers. Moreover, you can share data volumes
|
||||
with other computing resources in your system.
|
||||
|
||||
To see help for a subcommand, use:
|
||||
|
||||
docker volume COMMAND --help
|
||||
|
||||
For full details on using docker volume visit Docker's online documentation.
|
||||
|
||||
`
|
||||
|
|
|
@ -28,7 +28,6 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "create [OPTIONS] [VOLUME]",
|
||||
Short: "Create a volume",
|
||||
Long: createDescription,
|
||||
Args: cli.RequiresMaxArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) == 1 {
|
||||
|
@ -69,42 +68,3 @@ func runCreate(dockerCli *command.DockerCli, opts createOptions) error {
|
|||
fmt.Fprintf(dockerCli.Out(), "%s\n", vol.Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
var createDescription = `
|
||||
Creates a new volume that containers can consume and store data in. If a name
|
||||
is not specified, Docker generates a random name. You create a volume and then
|
||||
configure the container to use it, for example:
|
||||
|
||||
$ docker volume create hello
|
||||
hello
|
||||
$ docker run -d -v hello:/world busybox ls /world
|
||||
|
||||
The mount is created inside the container's **/src** directory. Docker doesn't
|
||||
not support relative paths for mount points inside the container.
|
||||
|
||||
Multiple containers can use the same volume in the same time period. This is
|
||||
useful if two containers need access to shared data. For example, if one
|
||||
container writes and the other reads the data.
|
||||
|
||||
## Driver specific options
|
||||
|
||||
Some volume drivers may take options to customize the volume creation. Use the
|
||||
**-o** or **--opt** flags to pass driver options:
|
||||
|
||||
$ docker volume create --driver fake --opt tardis=blue --opt timey=wimey
|
||||
|
||||
These options are passed directly to the volume driver. Options for different
|
||||
volume drivers may do different things (or nothing at all).
|
||||
|
||||
The built-in **local** driver on Windows does not support any options.
|
||||
|
||||
The built-in **local** driver on Linux accepts options similar to the linux
|
||||
**mount** command:
|
||||
|
||||
$ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000
|
||||
|
||||
Another example:
|
||||
|
||||
$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2
|
||||
|
||||
`
|
||||
|
|
|
@ -20,7 +20,6 @@ func newInspectCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "inspect [OPTIONS] VOLUME [VOLUME...]",
|
||||
Short: "Display detailed information on one or more volumes",
|
||||
Long: inspectDescription,
|
||||
Args: cli.RequiresMinArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
opts.names = args
|
||||
|
@ -45,11 +44,3 @@ func runInspect(dockerCli *command.DockerCli, opts inspectOptions) error {
|
|||
|
||||
return inspect.Inspect(dockerCli.Out(), opts.names, opts.format, getVolFunc)
|
||||
}
|
||||
|
||||
var inspectDescription = `
|
||||
Returns information about one or more volumes. By default, this command renders
|
||||
all results in a JSON array. You can specify an alternate format to execute a
|
||||
given template is executed for each result. Go's https://golang.org/pkg/text/template/
|
||||
package describes all the details of the format.
|
||||
|
||||
`
|
||||
|
|
|
@ -34,7 +34,6 @@ func newListCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|||
Use: "ls [OPTIONS]",
|
||||
Aliases: []string{"list"},
|
||||
Short: "List volumes",
|
||||
Long: listDescription,
|
||||
Args: cli.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return runList(dockerCli, opts)
|
||||
|
@ -73,19 +72,3 @@ func runList(dockerCli *command.DockerCli, opts listOptions) error {
|
|||
}
|
||||
return formatter.VolumeWrite(volumeCtx, volumes.Volumes)
|
||||
}
|
||||
|
||||
var listDescription = `
|
||||
|
||||
Lists all the volumes Docker manages. You can filter using the **-f** or
|
||||
**--filter** flag. The filtering format is a **key=value** pair. To specify
|
||||
more than one filter, pass multiple flags (for example,
|
||||
**--filter "foo=bar" --filter "bif=baz"**)
|
||||
|
||||
The currently supported filters are:
|
||||
|
||||
* **dangling** (boolean - **true** or **false**, **1** or **0**)
|
||||
* **driver** (a volume driver's name)
|
||||
* **label** (**label=<key>** or **label=<key>=<value>**)
|
||||
* **name** (a volume's name)
|
||||
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue