mirror of
https://github.com/docker/buildx.git
synced 2024-11-22 15:37:16 +08:00
04b44b3a89
The --builder flag was being ignored by imagetools because of pointer problems. Essentially, because the root cmds aren't parsed immediately, we need to pass a pointer to the builder string so that it can be updated before the RunE function gets called. Signed-off-by: Justin Chadwell <me@jedevc.com>
25 lines
408 B
Go
25 lines
408 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/docker/cli/cli/command"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
type RootOptions struct {
|
|
Builder *string
|
|
}
|
|
|
|
func RootCmd(dockerCli command.Cli, opts RootOptions) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "imagetools",
|
|
Short: "Commands to work on images in registry",
|
|
}
|
|
|
|
cmd.AddCommand(
|
|
createCmd(dockerCli, opts),
|
|
inspectCmd(dockerCli, opts),
|
|
)
|
|
|
|
return cmd
|
|
}
|