From cfb8cbe5214c58690ca99cd44b25bd202c4dbcf7 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Tue, 28 May 2013 13:51:21 -0700 Subject: [PATCH] Small fix --- buildfile.go | 3 +++ commands.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildfile.go b/buildfile.go index f1e08b20fc..88dcadbf90 100644 --- a/buildfile.go +++ b/buildfile.go @@ -188,6 +188,9 @@ func (b *buildFile) CmdInsert(args string) error { } func (b *buildFile) CmdAdd(args string) error { + if b.context == "" { + return fmt.Errorf("No context given. Impossible to use ADD") + } tmp := strings.SplitN(args, " ", 2) if len(tmp) != 2 { return fmt.Errorf("Invalid INSERT format") diff --git a/commands.go b/commands.go index a79a24bff7..5d65daeb57 100644 --- a/commands.go +++ b/commands.go @@ -175,7 +175,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error { if _, err := w.CreateFormFile("Context", cmd.Arg(0)+"."+compression.Extension()); err != nil { return err } - multipartBody = io.MultiReader(multipartBody, utils.ProgressReader(ioutil.NopCloser(context), -1, os.Stdout, "Uploading Context %v/%v (%v)", false)) + multipartBody = io.MultiReader(multipartBody, utils.ProgressReader(ioutil.NopCloser(context), -1, os.Stdout, "Uploading Context %v/%v (%v)\r", false)) } // Send the multipart request with correct content-type