fix: normalize Docker Desktop mount aliases
This commit is contained in:
@@ -136,6 +136,13 @@ func writeFileDurably(path, prefix string, contents []byte) error {
|
||||
}
|
||||
|
||||
func mountSourceHash(source string) string {
|
||||
source = filepath.Clean(source)
|
||||
for _, dockerDesktopPrefix := range []string{"/host_mnt/private/var/", "/host_mnt/Users/"} {
|
||||
if strings.HasPrefix(source, dockerDesktopPrefix) {
|
||||
source = strings.TrimPrefix(source, "/host_mnt")
|
||||
break
|
||||
}
|
||||
}
|
||||
sum := sha256.Sum256([]byte(source))
|
||||
return fmt.Sprintf("%x", sum[:])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user