From 90940b01377c5296c2638f83ac2d3acc309ada1d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 13 Oct 2025 17:43:35 +0200 Subject: [PATCH] pkg/compose: build with bake: drop support for buildx v0.16 and lower [buildx v0.17][1] was released a Year ago, so any version this conditional code was accounting for would be versions before that; the latest of which being [buildx v0.16.2][2] (July 2024). Given that those versions are long EOL and no longer supported, we can probably remove the conditional code. [1]: https://github.com/docker/buildx/releases/tag/v0.17.0 [2]: https://github.com/docker/buildx/releases/tag/v0.16.2 Signed-off-by: Sebastiaan van Stijn --- pkg/compose/build_bake.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkg/compose/build_bake.go b/pkg/compose/build_bake.go index a2a8a59cc44..299c6f2f431 100644 --- a/pkg/compose/build_bake.go +++ b/pkg/compose/build_bake.go @@ -40,7 +40,6 @@ import ( "github.com/docker/cli/cli/command/image/build" "github.com/docker/compose/v2/pkg/api" "github.com/docker/compose/v2/pkg/progress" - "github.com/docker/docker/api/types/versions" "github.com/moby/buildkit/client" gitutil "github.com/moby/buildkit/frontend/dockerfile/dfgitutil" "github.com/moby/buildkit/util/progress/progressui" @@ -302,15 +301,12 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project } args := []string{"bake", "--file", "-", "--progress", "rawjson", "--metadata-file", metadataFile} - mustAllow := buildx.Version != "" && versions.GreaterThanOrEqualTo(buildx.Version[1:], "0.17.0") - if mustAllow { - // FIXME we should prompt user about this, but this is a breaking change in UX - for _, path := range read { - args = append(args, "--allow", "fs.read="+path) - } - if privileged { - args = append(args, "--allow", "security.insecure") - } + // FIXME we should prompt user about this, but this is a breaking change in UX + for _, path := range read { + args = append(args, "--allow", "fs.read="+path) + } + if privileged { + args = append(args, "--allow", "security.insecure") } if options.SBOM != "" { args = append(args, "--sbom="+options.SBOM)