2018-08-17 09:51:04 +00:00
|
|
|
package builder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"github.com/docker/cli/cli"
|
|
|
|
"github.com/docker/cli/cli/command"
|
2019-04-17 22:09:29 +00:00
|
|
|
"github.com/docker/cli/cli/command/image"
|
2018-08-17 09:51:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// NewBuilderCommand returns a cobra command for `builder` subcommands
|
|
|
|
func NewBuilderCommand(dockerCli command.Cli) *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
2019-01-30 01:06:09 +01:00
|
|
|
Use: "builder",
|
|
|
|
Short: "Manage builds",
|
|
|
|
Args: cli.NoArgs,
|
|
|
|
RunE: command.ShowHelp(dockerCli.Err()),
|
|
|
|
Annotations: map[string]string{"version": "1.31"},
|
2018-08-17 09:51:04 +00:00
|
|
|
}
|
|
|
|
cmd.AddCommand(
|
|
|
|
NewPruneCommand(dockerCli),
|
2019-04-17 22:09:29 +00:00
|
|
|
image.NewBuildCommand(dockerCli),
|
2018-08-17 09:51:04 +00:00
|
|
|
)
|
|
|
|
return cmd
|
|
|
|
}
|
2025-03-21 13:25:59 +01:00
|
|
|
|
|
|
|
// NewBakeStubCommand returns a cobra command "stub" for the "bake" subcommand.
|
|
|
|
// 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).
|
|
|
|
func NewBakeStubCommand(dockerCLI command.Streams) *cobra.Command {
|
|
|
|
return &cobra.Command{
|
|
|
|
Use: "bake [OPTIONS] [TARGET...]",
|
|
|
|
Short: "Build from a file",
|
|
|
|
RunE: command.ShowHelp(dockerCLI.Err()),
|
|
|
|
Annotations: map[string]string{
|
|
|
|
// We want to show this command in the "top" category in --help
|
|
|
|
// output, and not to be grouped under "management commands".
|
|
|
|
"category-top": "5",
|
|
|
|
"aliases": "docker buildx bake",
|
|
|
|
"version": "1.31",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|