瀏覽代碼

Merge pull request #16027 from Microsoft/10662-utimes

Windows: Fix dockerfile ADD from HTTP
Tibor Vass 9 年之前
父節點
當前提交
6ffbea3c94
共有 1 個文件被更改,包括 5 次插入2 次删除
  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))