Skip to content

Commit ae3309a

Browse files
thaJeztahndeloof
authored andcommitted
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 <[email protected]>
1 parent 0b5fb36 commit ae3309a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

pkg/compose/build_bake.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ 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"
4443
"github.com/moby/buildkit/client"
4544
gitutil "github.com/moby/buildkit/frontend/dockerfile/dfgitutil"
4645
"github.com/moby/buildkit/util/progress/progressui"
@@ -302,15 +301,12 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
302301
}
303302

304303
args := []string{"bake", "--file", "-", "--progress", "rawjson", "--metadata-file", metadataFile}
305-
mustAllow := buildx.Version != "" && versions.GreaterThanOrEqualTo(buildx.Version[1:], "0.17.0")
306-
if mustAllow {
307-
// FIXME we should prompt user about this, but this is a breaking change in UX
308-
for _, path := range read {
309-
args = append(args, "--allow", "fs.read="+path)
310-
}
311-
if privileged {
312-
args = append(args, "--allow", "security.insecure")
313-
}
304+
// FIXME we should prompt user about this, but this is a breaking change in UX
305+
for _, path := range read {
306+
args = append(args, "--allow", "fs.read="+path)
307+
}
308+
if privileged {
309+
args = append(args, "--allow", "security.insecure")
314310
}
315311
if options.SBOM != "" {
316312
args = append(args, "--sbom="+options.SBOM)

0 commit comments

Comments
 (0)