fix: normalize Docker Desktop mount aliases

This commit is contained in:
2026-08-09 00:28:25 +02:00
parent fa151c5ea5
commit fb95be3e62
2 changed files with 26 additions and 0 deletions
+7
View File
@@ -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[:])
}