github.com/xeptore/docker-cli@v20.10.14+incompatible/cli/command/manifest/cmd.go (about)

     1  package manifest
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/docker/cli/cli"
     7  	"github.com/docker/cli/cli/command"
     8  
     9  	"github.com/spf13/cobra"
    10  )
    11  
    12  // NewManifestCommand returns a cobra command for `manifest` subcommands
    13  func NewManifestCommand(dockerCli command.Cli) *cobra.Command {
    14  	// use dockerCli as command.Cli
    15  	cmd := &cobra.Command{
    16  		Use:   "manifest COMMAND",
    17  		Short: "Manage Docker image manifests and manifest lists",
    18  		Long:  manifestDescription,
    19  		Args:  cli.NoArgs,
    20  		Run: func(cmd *cobra.Command, args []string) {
    21  			fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
    22  		},
    23  		Annotations: map[string]string{"experimentalCLI": ""},
    24  	}
    25  	cmd.AddCommand(
    26  		newCreateListCommand(dockerCli),
    27  		newInspectCommand(dockerCli),
    28  		newAnnotateCommand(dockerCli),
    29  		newPushListCommand(dockerCli),
    30  		newRmManifestListCommand(dockerCli),
    31  	)
    32  	return cmd
    33  }
    34  
    35  var manifestDescription = `
    36  The **docker manifest** command has subcommands for managing image manifests and
    37  manifest lists. A manifest list allows you to use one name to refer to the same image
    38  built for multiple architectures.
    39  
    40  To see help for a subcommand, use:
    41  
    42      docker manifest CMD --help
    43  
    44  For full details on using docker manifest lists, see the registry v2 specification.
    45  
    46  `