Skip to content

Commit 7e198ee

Browse files
committed
remove provenance build flag for now
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
1 parent 0566431 commit 7e198ee

5 files changed

Lines changed: 7 additions & 21 deletions

File tree

cmd/compose/build.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type buildOptions struct {
4646
deps bool
4747
print bool
4848
check bool
49-
provenance string
49+
provenance bool
5050
}
5151

5252
func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions, error) {
@@ -70,11 +70,6 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
7070
if uiMode == ui.ModeJSON {
7171
uiMode = "rawjson"
7272
}
73-
var provenance *string
74-
// empty when set by up, run or create functions and "none" when set by the user from the build command
75-
if opts.provenance != "" && opts.provenance != "none" {
76-
provenance = &opts.provenance
77-
}
7873

7974
return api.BuildOptions{
8075
Pull: opts.pull,
@@ -90,7 +85,7 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
9085
Check: opts.check,
9186
SSHs: SSHKeys,
9287
Builder: builderName,
93-
Provenance: provenance,
88+
Provenance: opts.provenance,
9489
}, nil
9590
}
9691

@@ -131,7 +126,6 @@ func buildCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
131126
flags.StringVar(&opts.ssh, "ssh", "", "Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)")
132127
flags.StringVar(&opts.builder, "builder", "", "Set builder to use")
133128
flags.BoolVar(&opts.deps, "with-dependencies", false, "Also build dependencies (transitively)")
134-
flags.StringVar(&opts.provenance, "provenance", "min", "Set provenance mode (none|min|max)")
135129

136130
flags.Bool("parallel", true, "Build images in parallel. DEPRECATED")
137131
flags.MarkHidden("parallel") //nolint:errcheck
@@ -162,6 +156,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, backend api.Service, o
162156
}
163157

164158
apiBuildOptions, err := opts.toAPIBuildOptions(services)
159+
apiBuildOptions.Provenance = true
165160
if err != nil {
166161
return err
167162
}

docs/reference/compose_build.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ run `docker compose build` to rebuild it.
2222
| `-m`, `--memory` | `bytes` | `0` | Set memory limit for the build container. Not supported by BuildKit. |
2323
| `--no-cache` | `bool` | | Do not use cache when building the image |
2424
| `--print` | `bool` | | Print equivalent bake file |
25-
| `--provenance` | `string` | `max` | Set provenance mode (none\|min\|max) |
2625
| `--pull` | `bool` | | Always attempt to pull a newer version of the image |
2726
| `--push` | `bool` | | Push service images |
2827
| `-q`, `--quiet` | `bool` | | Don't print anything to STDOUT |

docs/reference/docker_compose_build.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,6 @@ options:
126126
experimentalcli: false
127127
kubernetes: false
128128
swarm: false
129-
- option: provenance
130-
value_type: string
131-
default_value: max
132-
description: Set provenance mode (none|min|max)
133-
deprecated: false
134-
hidden: false
135-
experimental: false
136-
experimentalcli: false
137-
kubernetes: false
138-
swarm: false
139129
- option: pull
140130
value_type: bool
141131
default_value: "false"

pkg/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ type BuildOptions struct {
160160
// Check let builder validate build configuration
161161
Check bool
162162
// Provenance
163-
Provenance *string
163+
Provenance bool
164164
}
165165

166166
// Apply mutates project according to build options

pkg/compose/build.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
482482
}
483483

484484
attests := map[string]*string{}
485-
attests["provenance"] = options.Provenance
485+
if !options.Provenance {
486+
attests["provenance"] = nil
487+
}
486488

487489
return build.Options{
488490
Inputs: build.Inputs{

0 commit comments

Comments
 (0)