MCPcopy Create free account
hub / github.com/docker/docker-agent / Install

Method Install

pkg/toolinstall/installer.go:18–28  ·  view source on GitHub ↗

Install downloads and installs a package at the specified version. Returns the path to the installed binary.

(ctx context.Context, pkg *Package, version string)

Source from the content-addressed store, hash-verified

16// Install downloads and installs a package at the specified version.
17// Returns the path to the installed binary.
18func (r *Registry) Install(ctx context.Context, pkg *Package, version string) (string, error) {
19 // Apply the aqua version_override matching this version before deciding
20 // how to install (asset, format, checksum, and even type can differ
21 // between versions).
22 pkg = resolveVersionOverride(pkg, version)
23
24 if pkg.IsGoPackage() {
25 return installGoPackage(ctx, pkg, version)
26 }
27 return r.installGitHubRelease(ctx, pkg, version)
28}
29
30// installGoPackage installs a Go package using "go install".
31func installGoPackage(ctx context.Context, pkg *Package, version string) (string, error) {

Calls 4

installGitHubReleaseMethod · 0.95
resolveVersionOverrideFunction · 0.85
installGoPackageFunction · 0.85
IsGoPackageMethod · 0.80