cmd.go 1.2 KB

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