mirror of
https://github.com/docker/compose.git
synced 2025-11-09 16:29:58 +01:00
fail build if minimal required version of buildx isn't installed
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
585c4db4f9
commit
e19e1278b5
@ -40,6 +40,7 @@ import (
|
|||||||
"github.com/docker/cli/cli/command/image/build"
|
"github.com/docker/cli/cli/command/image/build"
|
||||||
"github.com/docker/compose/v2/pkg/api"
|
"github.com/docker/compose/v2/pkg/api"
|
||||||
"github.com/docker/compose/v2/pkg/progress"
|
"github.com/docker/compose/v2/pkg/progress"
|
||||||
|
"github.com/docker/docker/api/types/versions"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/moby/buildkit/client"
|
"github.com/moby/buildkit/client"
|
||||||
gitutil "github.com/moby/buildkit/frontend/dockerfile/dfgitutil"
|
gitutil "github.com/moby/buildkit/frontend/dockerfile/dfgitutil"
|
||||||
@ -308,6 +309,10 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if versions.LessThan(buildx.Version[1:], "0.17.0") {
|
||||||
|
return nil, fmt.Errorf("compose build requires buildx 0.17 or later")
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{"bake", "--file", "-", "--progress", "rawjson", "--metadata-file", metadataFile}
|
args := []string{"bake", "--file", "-", "--progress", "rawjson", "--metadata-file", metadataFile}
|
||||||
// FIXME we should prompt user about this, but this is a breaking change in UX
|
// FIXME we should prompt user about this, but this is a breaking change in UX
|
||||||
for _, path := range read {
|
for _, path := range read {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user