Skip to content

Commit 2d97922

Browse files
authored
Merge pull request #6284 from Benehiko/commands/builder
Unexport the builder and bake stub command
2 parents 6dcf9ac + 1b9d076 commit 2d97922

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

cli/command/builder/cmd.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,23 @@ import (
99
)
1010

1111
// NewBuilderCommand returns a cobra command for `builder` subcommands
12-
func NewBuilderCommand(dockerCli command.Cli) *cobra.Command {
12+
//
13+
// Deprecated: Do not import commands directly. They will be removed in a future release.
14+
func NewBuilderCommand(dockerCLI command.Cli) *cobra.Command {
15+
return newBuilderCommand(dockerCLI)
16+
}
17+
18+
func newBuilderCommand(dockerCLI command.Cli) *cobra.Command {
1319
cmd := &cobra.Command{
1420
Use: "builder",
1521
Short: "Manage builds",
1622
Args: cli.NoArgs,
17-
RunE: command.ShowHelp(dockerCli.Err()),
23+
RunE: command.ShowHelp(dockerCLI.Err()),
1824
Annotations: map[string]string{"version": "1.31"},
1925
}
2026
cmd.AddCommand(
21-
NewPruneCommand(dockerCli),
22-
image.NewBuildCommand(dockerCli),
27+
NewPruneCommand(dockerCLI),
28+
image.NewBuildCommand(dockerCLI),
2329
)
2430
return cmd
2531
}
@@ -28,7 +34,13 @@ func NewBuilderCommand(dockerCli command.Cli) *cobra.Command {
2834
// This command is a placeholder / stub that is dynamically replaced by an
2935
// alias for "docker buildx bake" if BuildKit is enabled (and the buildx plugin
3036
// installed).
37+
//
38+
// Deprecated: Do not import commands directly. They will be removed in a future release.
3139
func NewBakeStubCommand(dockerCLI command.Streams) *cobra.Command {
40+
return newBakeStubCommand(dockerCLI)
41+
}
42+
43+
func newBakeStubCommand(dockerCLI command.Streams) *cobra.Command {
3244
return &cobra.Command{
3345
Use: "bake [OPTIONS] [TARGET...]",
3446
Short: "Build from a file",

cli/command/commands/commands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
4343
system.NewInfoCommand(dockerCli),
4444

4545
// management commands
46+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4647
builder.NewBakeStubCommand(dockerCli),
48+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4749
builder.NewBuilderCommand(dockerCli),
4850
checkpoint.NewCheckpointCommand(dockerCli),
4951
container.NewContainerCommand(dockerCli),

0 commit comments

Comments
 (0)