flags.go 805 B

123456789101112131415161718192021222324252627282930313233
  1. package context
  2. import (
  3. "path/filepath"
  4. "github.com/docker/docker/pkg/homedir"
  5. "github.com/urfave/cli"
  6. )
  7. const (
  8. // ConfigFileName is the name of config file
  9. ConfigFileName = "config.json"
  10. configFileDir = ".docker"
  11. )
  12. var (
  13. ConfigDir string
  14. ConfigFlag = cli.StringFlag{
  15. Name: "config",
  16. Usage: "Location of client config files `DIRECTORY`",
  17. EnvVar: "DOCKER_CONFIG",
  18. Value: filepath.Join(homedir.Get(), configFileDir),
  19. Destination: &ConfigDir,
  20. }
  21. ContextName string
  22. ContextFlag = cli.StringFlag{
  23. Name: "context, c",
  24. Usage: "Name of the context `CONTEXT` to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with \"docker context use\")",
  25. EnvVar: "DOCKER_CONTEXT",
  26. Destination: &ContextName,
  27. }
  28. )