github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/cli/command/volume/cmd.go (about)

     1  package volume
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/spf13/cobra"
     7  
     8  	"github.com/docker/docker/cli"
     9  	"github.com/docker/docker/cli/command"
    10  )
    11  
    12  // NewVolumeCommand returns a cobra command for `volume` subcommands
    13  func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command {
    14  	cmd := &cobra.Command{
    15  		Use:   "volume COMMAND",
    16  		Short: "Manage 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  		NewPruneCommand(dockerCli),
    29  	)
    30  	return cmd
    31  }
    32  
    33  var volumeDescription = `
    34  The **docker volume** command has subcommands for managing data volumes. A data
    35  volume is a specially-designated directory that by-passes storage driver
    36  management.
    37  
    38  Data volumes persist data independent of a container's life cycle. When you
    39  delete a container, the Engine daemon does not delete any data volumes. You can
    40  share volumes across multiple containers. Moreover, you can share data volumes
    41  with other computing resources in your system.
    42  
    43  To see help for a subcommand, use:
    44  
    45      docker volume CMD help
    46  
    47  For full details on using docker volume visit Docker's online documentation.
    48  
    49  `