From 16aa7dd67fc20f15690b145f30e921d783746cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Tue, 27 Feb 2024 11:04:25 +0100 Subject: [PATCH] c8d/pull: Output truncated id for `Pulling fs layer` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All other progress updates are emitted with truncated id. ```diff $ docker pull --platform linux/amd64 alpine Using default tag: latest latest: Pulling from library/alpine -sha256:4abcf20661432fb2d719aaf90656f55c287f8ca915dc1c92ec14ff61e67fbaf8: Pulling fs layer +4abcf2066143: Download complete Digest: sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b Status: Image is up to date for alpine:latest docker.io/library/alpine:latest ``` Signed-off-by: Paweł Gronowski --- daemon/containerd/image_pull.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/containerd/image_pull.go b/daemon/containerd/image_pull.go index 1614f1081b..88ef659f2d 100644 --- a/daemon/containerd/image_pull.go +++ b/daemon/containerd/image_pull.go @@ -21,6 +21,7 @@ import ( "github.com/docker/docker/internal/compatcontext" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" + "github.com/docker/docker/pkg/stringid" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) @@ -118,7 +119,8 @@ func (i *ImageService) pullTag(ctx context.Context, ref reference.Named, platfor sentSchema1Deprecation = true } if images.IsLayerType(desc.MediaType) { - progress.Update(out, desc.Digest.String(), "Pulling fs layer") + id := stringid.TruncateID(desc.Digest.String()) + progress.Update(out, id, "Pulling fs layer") } if images.IsManifestType(desc.MediaType) { if !sentPullingFrom {