1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

* Builder: upload progress bar

Fix progress bar
This commit is contained in:
Solomon Hykes 2013-06-17 18:26:41 -07:00
parent fe88b5068d
commit 0809f649d3
2 changed files with 6 additions and 1 deletions

1
FIXME
View file

@ -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

View file

@ -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
}