Skip to content

Commit e19e127

Browse files
committed
fail build if minimal required version of buildx isn't installed
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent 585c4db commit e19e127

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/compose/build_bake.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
"github.com/docker/cli/cli/command/image/build"
4141
"github.com/docker/compose/v2/pkg/api"
4242
"github.com/docker/compose/v2/pkg/progress"
43+
"github.com/docker/docker/api/types/versions"
4344
"github.com/google/uuid"
4445
"github.com/moby/buildkit/client"
4546
gitutil "github.com/moby/buildkit/frontend/dockerfile/dfgitutil"
@@ -308,6 +309,10 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
308309
return nil, err
309310
}
310311

312+
if versions.LessThan(buildx.Version[1:], "0.17.0") {
313+
return nil, fmt.Errorf("compose build requires buildx 0.17 or later")
314+
}
315+
311316
args := []string{"bake", "--file", "-", "--progress", "rawjson", "--metadata-file", metadataFile}
312317
// FIXME we should prompt user about this, but this is a breaking change in UX
313318
for _, path := range read {

0 commit comments

Comments
 (0)