mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	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
 | 
						|
}
 |