Jelajahi Sumber

Windows: Fix dockerfile ADD from HTTP

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 10 tahun lalu
induk
melakukan
3715e60c71
1 mengubah file dengan 5 tambahan dan 2 penghapusan
  1. 5 2
      builder/internals.go

+ 5 - 2
builder/internals.go

@@ -348,8 +348,11 @@ func calcCopyInfo(b *builder, cmdName string, cInfos *[]*copyInfo, origPath stri
 			}
 			}
 		}
 		}
 
 
-		if err := system.UtimesNano(tmpFileName, times); err != nil {
-			return err
+		// Windows does not support UtimesNano.
+		if runtime.GOOS != "windows" {
+			if err := system.UtimesNano(tmpFileName, times); err != nil {
+				return err
+			}
 		}
 		}
 
 
 		ci.origPath = filepath.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName))
 		ci.origPath = filepath.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName))