moby/pkg/plugins/discovery_windows.go
Jan Garcia 1e1d326b50 plugins: Move GlobalSpecPaths into LocalRegistry
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
2023-01-10 21:33:49 +01:00

15 lines
575 B
Go

package plugins // import "github.com/docker/docker/pkg/plugins"
import (
"os"
"path/filepath"
)
// SpecsPaths returns
// { "%programdata%\docker\plugins" } on Windows,
// { "/etc/docker/plugins", "/usr/lib/docker/plugins" } on Unix in non-rootless mode,
// { "$XDG_CONFIG_HOME/docker/plugins", "$HOME/.local/lib/docker/plugins" } on Unix in rootless mode
// with fallback to the corresponding path in non-rootless mode if $XDG_CONFIG_HOME or $HOME is not set.
func SpecsPaths() []string {
return []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")}
}