driver/docker-container: remove uses of jsonmessage

This function was always using `io.Discard` for printing the progress,
so we can use the `Wait()` method, which reads the stream, returning
any error (similar to jsonmessage.DisplayJSONMessagesStream), and
closes the stream either if the context is cancelled, or if the
stream ends.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-04-21 13:35:39 +02:00
parent 872d8e5e58
commit 76ba2fac5c
3 changed files with 1 additions and 298 deletions
+1 -3
View File
@@ -28,7 +28,6 @@ import (
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/api/types/mount"
dockerclient "github.com/moby/moby/client"
"github.com/moby/moby/client/pkg/jsonmessage"
"github.com/moby/moby/client/pkg/security"
"github.com/pkg/errors"
)
@@ -104,8 +103,7 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
if err != nil {
return err
}
defer resp.Close()
return jsonmessage.DisplayStream(resp, io.Discard)
return resp.Wait(ctx)
}); err != nil {
// image pulling failed, check if it exists in local image store.
// if not, return pulling error. otherwise log it.