diff --git a/FIXME b/FIXME index b88757e229..c0bbd7e482 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 274ea6fae5..39cf749ef8 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 }