moby/pkg/plugins/discovery_windows.go
Jan Garcia 33572e98c1
Use user paths for plugin discovery in rootless mode
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
(cherry picked from commit c1bd5e9144)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 11:26:12 +01:00

17 lines
616 B
Go

package plugins // import "github.com/docker/docker/pkg/plugins"
import (
"os"
"path/filepath"
)
var globalSpecsPaths = []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")}
// 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 globalSpecsPaths
}