common.go 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package cli
  2. import (
  3. flag "github.com/docker/docker/pkg/mflag"
  4. "github.com/docker/go-connections/tlsconfig"
  5. )
  6. // CommonFlags represents flags that are common to both the client and the daemon.
  7. type CommonFlags struct {
  8. FlagSet *flag.FlagSet
  9. PostParse func()
  10. Debug bool
  11. Hosts []string
  12. LogLevel string
  13. TLS bool
  14. TLSVerify bool
  15. TLSOptions *tlsconfig.Options
  16. TrustKey string
  17. }
  18. // Command is the struct containing the command name and description
  19. type Command struct {
  20. Name string
  21. Description string
  22. }
  23. var dockerCommands = []Command{
  24. {"attach", "Attach to a running container"},
  25. {"build", "Build an image from a Dockerfile"},
  26. {"commit", "Create a new image from a container's changes"},
  27. {"cp", "Copy files/folders between a container and the local filesystem"},
  28. {"create", "Create a new container"},
  29. {"diff", "Inspect changes on a container's filesystem"},
  30. {"events", "Get real time events from the server"},
  31. {"exec", "Run a command in a running container"},
  32. {"export", "Export a container's filesystem as a tar archive"},
  33. {"history", "Show the history of an image"},
  34. {"images", "List images"},
  35. {"import", "Import the contents from a tarball to create a filesystem image"},
  36. {"info", "Display system-wide information"},
  37. {"inspect", "Return low-level information on a container or image"},
  38. {"kill", "Kill a running container"},
  39. {"load", "Load an image from a tar archive or STDIN"},
  40. {"login", "Log in to a Docker registry"},
  41. {"logout", "Log out from a Docker registry"},
  42. {"logs", "Fetch the logs of a container"},
  43. {"network", "Manage Docker networks"},
  44. {"pause", "Pause all processes within a container"},
  45. {"port", "List port mappings or a specific mapping for the CONTAINER"},
  46. {"ps", "List containers"},
  47. {"pull", "Pull an image or a repository from a registry"},
  48. {"push", "Push an image or a repository to a registry"},
  49. {"rename", "Rename a container"},
  50. {"restart", "Restart a container"},
  51. {"rm", "Remove one or more containers"},
  52. {"rmi", "Remove one or more images"},
  53. {"run", "Run a command in a new container"},
  54. {"save", "Save one or more images to a tar archive"},
  55. {"search", "Search the Docker Hub for images"},
  56. {"start", "Start one or more stopped containers"},
  57. {"stats", "Display a live stream of container(s) resource usage statistics"},
  58. {"stop", "Stop a running container"},
  59. {"tag", "Tag an image into a repository"},
  60. {"top", "Display the running processes of a container"},
  61. {"unpause", "Unpause all processes within a container"},
  62. {"update", "Update configuration of one or more containers"},
  63. {"version", "Show the Docker version information"},
  64. {"volume", "Manage Docker volumes"},
  65. {"wait", "Block until a container stops, then print its exit code"},
  66. }
  67. // DockerCommands stores all the docker command
  68. var DockerCommands = make(map[string]Command)
  69. func init() {
  70. for _, cmd := range dockerCommands {
  71. DockerCommands[cmd.Name] = cmd
  72. }
  73. }