瀏覽代碼

Merge pull request #28501 from tonistiigi/fix-daemon-cmd

Skip cli initialization for daemon command
Victor Vieux 8 年之前
父節點
當前提交
bb845dbd42
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      cmd/docker/docker.go

+ 4 - 0
cmd/docker/docker.go

@@ -39,6 +39,10 @@ func newDockerCommand(dockerCli *command.DockerCli) *cobra.Command {
 			return nil
 			return nil
 		},
 		},
 		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
 		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+			// daemon command is special, we redirect directly to another binary
+			if cmd.Name() == "daemon" {
+				return nil
+			}
 			// flags must be the top-level command flags, not cmd.Flags()
 			// flags must be the top-level command flags, not cmd.Flags()
 			opts.Common.SetDefaultOptions(flags)
 			opts.Common.SetDefaultOptions(flags)
 			dockerPreRun(opts)
 			dockerPreRun(opts)