diff --git a/pkg/skaffold/docker/image.go b/pkg/skaffold/docker/image.go index a1ac61025f5..efe2f488cc9 100644 --- a/pkg/skaffold/docker/image.go +++ b/pkg/skaffold/docker/image.go @@ -31,7 +31,6 @@ import ( "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" - "github.com/docker/docker/pkg/term" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -220,11 +219,19 @@ func (l *localDaemon) Build(ctx context.Context, out io.Writer, workspace string return imageID, nil } +type descriptor interface { + Fd() uintptr +} + // streamDockerMessages streams formatted json output from the docker daemon -// TODO(@r2d4): Make this output much better, this is the bare minimum func streamDockerMessages(dst io.Writer, src io.Reader, auxCallback func(jsonmessage.JSONMessage)) error { - fd, _ := term.GetFdInfo(dst) - return jsonmessage.DisplayJSONMessagesStream(src, dst, fd, false, auxCallback) + var termFd uintptr + f, isTerm := dst.(descriptor) + if isTerm { + termFd = f.Fd() + } + + return jsonmessage.DisplayJSONMessagesStream(src, dst, termFd, isTerm, auxCallback) } // Push pushes an image reference to a registry. Returns the image digest.