diff --git a/build/build.go b/build/build.go index 7f0256fb..8e548b26 100644 --- a/build/build.go +++ b/build/build.go @@ -26,6 +26,7 @@ import ( "github.com/moby/buildkit/session" "github.com/moby/buildkit/session/upload/uploadprovider" "github.com/moby/buildkit/util/entitlements" + "github.com/moby/buildkit/util/progress/progresswriter" "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -527,6 +528,15 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do defers = append(defers, release) m[k][i].so = so } + for _, at := range opt.Session { + if s, ok := at.(interface { + SetLogger(progresswriter.Logger) + }); ok { + s.SetLogger(func(s *client.SolveStatus) { + w.Write(s) + }) + } + } } resp = map[string]*client.SolveResponse{}