diff --git a/FIXME b/FIXME index b88757e229f748bda01d8290f4356534ca8c58d9..c0bbd7e4829b9604c789f71cd4e1d353cdd8c2b1 100644 --- a/FIXME +++ b/FIXME @@ -34,3 +34,4 @@ to put them - so we put them here :) * Caching after an ADD * entry point config * bring back git revision info, looks like it was lost +* Clean up the ProgressReader api, it's a PITA to use diff --git a/commands.go b/commands.go index 274ea6fae5e0ae8046e79f792a1a56d046d4698e..39cf749ef8b03f43b4c20d261e35c173fbc4c2d1 100644 --- a/commands.go +++ b/commands.go @@ -185,10 +185,14 @@ func (cli *DockerCli) CmdBuild(args ...string) error { if err != nil { return err } + // Setup an upload progress bar + // FIXME: ProgressReader shouldn't be this annoyning to use + sf := utils.NewStreamFormatter(false) + body := utils.ProgressReader(ioutil.NopCloser(context), 0, os.Stderr, sf.FormatProgress("Uploading context", "%v bytes%0.0s%0.0s"), sf) // Upload the build context v := &url.Values{} v.Set("t", *tag) - req, err := http.NewRequest("POST", fmt.Sprintf("http://%s:%d%s?%s", cli.host, cli.port, "/build", v.Encode()), context) + req, err := http.NewRequest("POST", fmt.Sprintf("http://%s:%d%s?%s", cli.host, cli.port, "/build", v.Encode()), body) if err != nil { return err }