diff --git a/remotes/docker/config/config_unix.go b/remotes/docker/config/config_unix.go index 092b82a87..6967f680d 100644 --- a/remotes/docker/config/config_unix.go +++ b/remotes/docker/config/config_unix.go @@ -24,16 +24,18 @@ import ( "path/filepath" ) -func hostPaths(root, host string) []string { +func hostPaths(root, host string) (hosts []string) { ch := hostDirectory(host) - if ch == host { - return []string{filepath.Join(root, host)} + if ch != host { + hosts = append(hosts, filepath.Join(root, ch)) } - return []string{ - filepath.Join(root, ch), + hosts = append(hosts, filepath.Join(root, host), - } + filepath.Join(root, "_default"), + ) + + return } func rootSystemPool() (*x509.CertPool, error) { diff --git a/remotes/docker/config/config_windows.go b/remotes/docker/config/config_windows.go index 4a9d3361e..4697728b9 100644 --- a/remotes/docker/config/config_windows.go +++ b/remotes/docker/config/config_windows.go @@ -22,16 +22,18 @@ import ( "strings" ) -func hostPaths(root, host string) []string { +func hostPaths(root, host string) (hosts []string) { ch := hostDirectory(host) - if ch == host { - return []string{filepath.Join(root, host)} + if ch != host { + hosts = append(hosts, filepath.Join(root, strings.Replace(ch, ":", "", -1))) } - return []string{ - filepath.Join(root, strings.Replace(ch, ":", "", -1)), + hosts = append(hosts, filepath.Join(root, strings.Replace(host, ":", "", -1)), - } + filepath.Join(root, "_default"), + ) + + return } func rootSystemPool() (*x509.CertPool, error) {