diff --git a/cli/command/builder/cmd.go b/cli/command/builder/cmd.go index ba2c069e89..29a8422313 100644 --- a/cli/command/builder/cmd.go +++ b/cli/command/builder/cmd.go @@ -9,17 +9,23 @@ import ( ) // NewBuilderCommand returns a cobra command for `builder` subcommands -func NewBuilderCommand(dockerCli command.Cli) *cobra.Command { +// +// Deprecated: Do not import commands directly. They will be removed in a future release. +func NewBuilderCommand(dockerCLI command.Cli) *cobra.Command { + return newBuilderCommand(dockerCLI) +} + +func newBuilderCommand(dockerCLI command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "builder", Short: "Manage builds", Args: cli.NoArgs, - RunE: command.ShowHelp(dockerCli.Err()), + RunE: command.ShowHelp(dockerCLI.Err()), Annotations: map[string]string{"version": "1.31"}, } cmd.AddCommand( - NewPruneCommand(dockerCli), - image.NewBuildCommand(dockerCli), + NewPruneCommand(dockerCLI), + image.NewBuildCommand(dockerCLI), ) return cmd } @@ -28,7 +34,13 @@ func NewBuilderCommand(dockerCli command.Cli) *cobra.Command { // This command is a placeholder / stub that is dynamically replaced by an // alias for "docker buildx bake" if BuildKit is enabled (and the buildx plugin // installed). +// +// Deprecated: Do not import commands directly. They will be removed in a future release. func NewBakeStubCommand(dockerCLI command.Streams) *cobra.Command { + return newBakeStubCommand(dockerCLI) +} + +func newBakeStubCommand(dockerCLI command.Streams) *cobra.Command { return &cobra.Command{ Use: "bake [OPTIONS] [TARGET...]", Short: "Build from a file", diff --git a/cli/command/commands/commands.go b/cli/command/commands/commands.go index d392929399..c7a55ec16d 100644 --- a/cli/command/commands/commands.go +++ b/cli/command/commands/commands.go @@ -43,7 +43,9 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) { system.NewInfoCommand(dockerCli), // management commands + //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283) builder.NewBakeStubCommand(dockerCli), + //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283) builder.NewBuilderCommand(dockerCli), checkpoint.NewCheckpointCommand(dockerCli), container.NewContainerCommand(dockerCli),