(dockerCLI command.Cli)
| 24 | } |
| 25 | |
| 26 | func newInstallCommand(dockerCLI command.Cli) *cobra.Command { |
| 27 | var options pluginOptions |
| 28 | cmd := &cobra.Command{ |
| 29 | Use: "install [OPTIONS] PLUGIN [KEY=VALUE...]", |
| 30 | Short: "Install a plugin", |
| 31 | Args: cli.RequiresMinArgs(1), |
| 32 | RunE: func(cmd *cobra.Command, args []string) error { |
| 33 | options.remote = args[0] |
| 34 | if len(args) > 1 { |
| 35 | options.args = args[1:] |
| 36 | } |
| 37 | return runInstall(cmd.Context(), dockerCLI, options) |
| 38 | }, |
| 39 | ValidArgsFunction: cobra.NoFileCompletions, |
| 40 | DisableFlagsInUseLine: true, |
| 41 | } |
| 42 | |
| 43 | flags := cmd.Flags() |
| 44 | flags.BoolVar(&options.grantPerms, "grant-all-permissions", false, "Grant all permissions necessary to run the plugin") |
| 45 | flags.BoolVar(&options.disable, "disable", false, "Do not enable the plugin on install") |
| 46 | flags.StringVar(&options.localName, "alias", "", "Local name for plugin") |
| 47 | |
| 48 | // TODO(thaJeztah): DEPRECATED: remove in v29.1 or v30 |
| 49 | flags.Bool("disable-content-trust", true, "Skip image verification (deprecated)") |
| 50 | _ = flags.MarkDeprecated("disable-content-trust", "support for docker content trust was removed") |
| 51 | return cmd |
| 52 | } |
| 53 | |
| 54 | func buildPullConfig(dockerCLI command.Cli, opts pluginOptions) (client.PluginInstallOptions, error) { |
| 55 | // Names with both tag and digest will be treated by the daemon |
searching dependent graphs…