github.com/portworx/docker@v1.12.1/api/client/volume/cmd.go (about)

     1  package volume
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/spf13/cobra"
     7  
     8  	"github.com/docker/docker/api/client"
     9  	"github.com/docker/docker/cli"
    10  )
    11  
    12  // NewVolumeCommand returns a cobra command for `volume` subcommands
    13  func NewVolumeCommand(dockerCli *client.DockerCli) *cobra.Command {
    14  	cmd := &cobra.Command{
    15  		Use:   "volume COMMAND",
    16  		Short: "Manage Docker volumes",
    17  		Long:  volumeDescription,
    18  		Args:  cli.NoArgs,
    19  		Run: func(cmd *cobra.Command, args []string) {
    20  			fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
    21  		},
    22  	}
    23  	cmd.AddCommand(
    24  		newCreateCommand(dockerCli),
    25  		newInspectCommand(dockerCli),
    26  		newListCommand(dockerCli),
    27  		newRemoveCommand(dockerCli),
    28  	)
    29  	return cmd
    30  }
    31  
    32  var volumeDescription = `
    33  The **docker volume** command has subcommands for managing data volumes. A data
    34  volume is a specially-designated directory that by-passes storage driver
    35  management.
    36  
    37  Data volumes persist data independent of a container's life cycle. When you
    38  delete a container, the Engine daemon does not delete any data volumes. You can
    39  share volumes across multiple containers. Moreover, you can share data volumes
    40  with other computing resources in your system.
    41  
    42  To see help for a subcommand, use:
    43  
    44      docker volume CMD help
    45  
    46  For full details on using docker volume visit Docker's online documentation.
    47  
    48  `