diff --git a/command/cli.go b/command/cli.go index be82ecf6f3..9b61492442 100644 --- a/command/cli.go +++ b/command/cli.go @@ -45,7 +45,7 @@ type DockerCli struct { func (cli *DockerCli) HasExperimental() bool { if cli.hasExperimental == nil { if cli.client == nil { - cli.Initialize(cliflags.NewClientOptions()) + return false } enabled := false cli.hasExperimental = &enabled diff --git a/command/commands/commands.go b/command/commands/commands.go index 425f90ba7d..fad709bca1 100644 --- a/command/commands/commands.go +++ b/command/commands/commands.go @@ -70,17 +70,12 @@ func AddCommands(cmd *cobra.Command, dockerCli *command.DockerCli) { hide(image.NewSaveCommand(dockerCli)), hide(image.NewTagCommand(dockerCli)), hide(system.NewInspectCommand(dockerCli)), + stack.NewStackCommand(dockerCli), + stack.NewTopLevelDeployCommand(dockerCli), + checkpoint.NewCheckpointCommand(dockerCli), + plugin.NewPluginCommand(dockerCli), ) - if dockerCli.HasExperimental() { - cmd.AddCommand( - stack.NewStackCommand(dockerCli), - stack.NewTopLevelDeployCommand(dockerCli), - checkpoint.NewCheckpointCommand(dockerCli), - plugin.NewPluginCommand(dockerCli), - ) - } - } func hide(cmd *cobra.Command) *cobra.Command { diff --git a/command/container/start.go b/command/container/start.go index 8e0654da37..e544028932 100644 --- a/command/container/start.go +++ b/command/container/start.go @@ -45,11 +45,10 @@ func NewStartCommand(dockerCli *command.DockerCli) *cobra.Command { flags.BoolVarP(&opts.openStdin, "interactive", "i", false, "Attach container's STDIN") flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container") - if dockerCli.HasExperimental() { - flags.StringVar(&opts.checkpoint, "checkpoint", "", "Restore from this checkpoint") - flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") - } - + flags.StringVar(&opts.checkpoint, "checkpoint", "", "Restore from this checkpoint") + flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") + flags.SetAnnotation("checkpoint", "experimental", nil) + flags.SetAnnotation("checkpoint-dir", "experimental", nil) return cmd } diff --git a/command/image/build.go b/command/image/build.go index dc18601900..5cf36cfd53 100644 --- a/command/image/build.go +++ b/command/image/build.go @@ -111,9 +111,8 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command { command.AddTrustedFlags(flags, true) - if dockerCli.HasExperimental() { - flags.BoolVar(&options.squash, "squash", false, "Squash newly built layers into a single new layer") - } + flags.BoolVar(&options.squash, "squash", false, "Squash newly built layers into a single new layer") + flags.SetAnnotation("squash", "experimental", nil) return cmd }