From 0b70f6e8176577221ab469f26a154b18380fa948 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 19 Feb 2026 09:46:26 +0100 Subject: [PATCH] cli/command/image: close ProgressReader progress.NewProgressReader implements io.ReadCloser. client.ImageBuild only requests an io.Reader, and there's some code in place to assert if the passed io.Reader was an io.ReadCloser, but let's make sure it's closed just in case. Signed-off-by: Sebastiaan van Stijn --- cli/command/image/build.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/command/image/build.go b/cli/command/image/build.go index db33e0e7c64d..d166a97fec71 100644 --- a/cli/command/image/build.go +++ b/cli/command/image/build.go @@ -315,9 +315,10 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) buildCtx = dockerfileCtx } - var body io.Reader + var body io.ReadCloser if buildCtx != nil { body = progress.NewProgressReader(buildCtx, progressOutput, 0, "", "Sending build context to Docker daemon") + defer func() { _ = body.Close() }() } configFile := dockerCli.ConfigFile()