From 10eeaec70cd3a2c5d52a132009cd3a8920641e3a Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 19 Dec 2013 12:32:58 -0800 Subject: [PATCH] fix progressbar in docker push --- docs/registry.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/registry.go b/docs/registry.go index 6c9255aa..3c793cf0 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -448,6 +448,11 @@ func (r *Registry) PushImageLayerRegistry(imgID string, layer io.Reader, registr if err != nil { return "", fmt.Errorf("Failed to upload layer: %s", err) } + if rc, ok := layer.(io.Closer); ok { + if err := rc.Close(); err != nil { + return "", err + } + } defer res.Body.Close() if res.StatusCode != 200 {