From 5ffdaa5cca5bb3aa4f6aafef9af6978988be5553 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Sun, 22 Nov 2020 18:37:01 +0100 Subject: [PATCH] Use json progress message It contains the same output that `docker pull` shows Signed-off-by: Djordje Lukic --- local/compose.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/local/compose.go b/local/compose.go index 0692c4e34..3a0cb9868 100644 --- a/local/compose.go +++ b/local/compose.go @@ -127,8 +127,6 @@ func (s *local) applyPullPolicy(ctx context.Context, service types.ServiceConfig func toProgressEvent(jm jsonmessage.JSONMessage, w progress.Writer) { if jm.Progress != nil { if jm.Progress.Total != 0 { - percentage := int(float64(jm.Progress.Current)/float64(jm.Progress.Total)*100) / 2 - numSpaces := 50 - percentage status := progress.Working if jm.Status == "Pull complete" { status = progress.Done @@ -137,7 +135,7 @@ func toProgressEvent(jm jsonmessage.JSONMessage, w progress.Writer) { ID: jm.ID, Text: jm.Status, Status: status, - StatusText: fmt.Sprintf("[%s>%s] ", strings.Repeat("=", percentage), strings.Repeat(" ", numSpaces)), + StatusText: jm.Progress.String(), }) } else { if jm.Error != nil {