From 0964347819b79d0e8bd5d21a1b1715cec2cf856c Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 11 Jan 2017 15:55:43 -0800 Subject: [PATCH] Windows: Use sequential file access Signed-off-by: John Howard --- command/utils.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/command/utils.go b/command/utils.go index 1837ca41f0..f9255cf87f 100644 --- a/command/utils.go +++ b/command/utils.go @@ -3,16 +3,19 @@ package command import ( "fmt" "io" - "io/ioutil" "os" "path/filepath" "runtime" "strings" + + "github.com/docker/docker/pkg/system" ) // CopyToFile writes the content of the reader to the specified file func CopyToFile(outfile string, r io.Reader) error { - tmpFile, err := ioutil.TempFile(filepath.Dir(outfile), ".docker_temp_") + // We use sequential file access here to avoid depleting the standby list + // on Windows. On Linux, this is a call directly to ioutil.TempFile + tmpFile, err := system.TempFileSequential(filepath.Dir(outfile), ".docker_temp_") if err != nil { return err }