Browse code

Add a progress bar for ADD <url> <dst>

Signed-off-by: Victor Vieux <vieux@docker.com>

Victor Vieux authored on 2014/09/03 09:17:08
Showing 1 changed files
... ...
@@ -151,10 +151,11 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
151 151
 		defer os.RemoveAll(tmpDirName)
152 152
 
153 153
 		// Download and dump result to tmp file
154
-		if _, err := io.Copy(tmpFile, resp.Body); err != nil {
154
+		if _, err := io.Copy(tmpFile, utils.ProgressReader(resp.Body, int(resp.ContentLength), b.OutOld, b.StreamFormatter, true, "", "Downloading")); err != nil {
155 155
 			tmpFile.Close()
156 156
 			return err
157 157
 		}
158
+		fmt.Fprintf(b.OutStream, "\n")
158 159
 		tmpFile.Close()
159 160
 
160 161
 		// Remove the mtime of the newly created tmp file