MCPcopy Index your code
hub / github.com/docker/cli / newInstallCommand

Function newInstallCommand

cli/command/plugin/install.go:26–52  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

24}
25
26func 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
54func buildPullConfig(dockerCLI command.Cli, opts pluginOptions) (client.PluginInstallOptions, error) {
55 // Names with both tag and digest will be treated by the daemon

Callers 3

newPluginCommandFunction · 0.85
TestInstallErrorsFunction · 0.85
TestInstallFunction · 0.85

Calls 1

runInstallFunction · 0.85

Tested by 2

TestInstallErrorsFunction · 0.68
TestInstallFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…