(dockerCLI command.Cli)
| 43 | } |
| 44 | |
| 45 | func newPushListCommand(dockerCLI command.Cli) *cobra.Command { |
| 46 | opts := pushOpts{} |
| 47 | |
| 48 | cmd := &cobra.Command{ |
| 49 | Use: "push [OPTIONS] MANIFEST_LIST", |
| 50 | Short: "Push a manifest list to a repository", |
| 51 | Args: cli.ExactArgs(1), |
| 52 | RunE: func(cmd *cobra.Command, args []string) error { |
| 53 | opts.target = args[0] |
| 54 | return runPush(cmd.Context(), dockerCLI, opts) |
| 55 | }, |
| 56 | DisableFlagsInUseLine: true, |
| 57 | } |
| 58 | |
| 59 | flags := cmd.Flags() |
| 60 | flags.BoolVarP(&opts.purge, "purge", "p", false, "Remove the local manifest list after push") |
| 61 | flags.BoolVar(&opts.insecure, "insecure", false, "Allow push to an insecure registry") |
| 62 | return cmd |
| 63 | } |
| 64 | |
| 65 | func runPush(ctx context.Context, dockerCli command.Cli, opts pushOpts) error { |
| 66 | targetRef, err := normalizeReference(opts.target) |
searching dependent graphs…