Browse Source

remove provenance build flag for now

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 6 months ago
parent
commit
7e198ee6a3

+ 3 - 8
cmd/compose/build.go

@@ -46,7 +46,7 @@ type buildOptions struct {
 	deps       bool
 	print      bool
 	check      bool
-	provenance string
+	provenance bool
 }
 
 func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions, error) {
@@ -70,11 +70,6 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
 	if uiMode == ui.ModeJSON {
 		uiMode = "rawjson"
 	}
-	var provenance *string
-	// empty when set by up, run or create functions and "none" when set by the user from the build command
-	if opts.provenance != "" && opts.provenance != "none" {
-		provenance = &opts.provenance
-	}
 
 	return api.BuildOptions{
 		Pull:       opts.pull,
@@ -90,7 +85,7 @@ func (opts buildOptions) toAPIBuildOptions(services []string) (api.BuildOptions,
 		Check:      opts.check,
 		SSHs:       SSHKeys,
 		Builder:    builderName,
-		Provenance: provenance,
+		Provenance: opts.provenance,
 	}, nil
 }
 
@@ -131,7 +126,6 @@ func buildCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
 	flags.StringVar(&opts.ssh, "ssh", "", "Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)")
 	flags.StringVar(&opts.builder, "builder", "", "Set builder to use")
 	flags.BoolVar(&opts.deps, "with-dependencies", false, "Also build dependencies (transitively)")
-	flags.StringVar(&opts.provenance, "provenance", "min", "Set provenance mode (none|min|max)")
 
 	flags.Bool("parallel", true, "Build images in parallel. DEPRECATED")
 	flags.MarkHidden("parallel") //nolint:errcheck
@@ -162,6 +156,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, backend api.Service, o
 	}
 
 	apiBuildOptions, err := opts.toAPIBuildOptions(services)
+	apiBuildOptions.Provenance = true
 	if err != nil {
 		return err
 	}

+ 0 - 1
docs/reference/compose_build.md

@@ -22,7 +22,6 @@ run `docker compose build` to rebuild it.
 | `-m`, `--memory`      | `bytes`       | `0`     | Set memory limit for the build container. Not supported by BuildKit.                                        |
 | `--no-cache`          | `bool`        |         | Do not use cache when building the image                                                                    |
 | `--print`             | `bool`        |         | Print equivalent bake file                                                                                  |
-| `--provenance`        | `string`      | `max`   | Set provenance mode (none\|min\|max)                                                                        |
 | `--pull`              | `bool`        |         | Always attempt to pull a newer version of the image                                                         |
 | `--push`              | `bool`        |         | Push service images                                                                                         |
 | `-q`, `--quiet`       | `bool`        |         | Don't print anything to STDOUT                                                                              |

+ 0 - 10
docs/reference/docker_compose_build.yaml

@@ -126,16 +126,6 @@ options:
       experimentalcli: false
       kubernetes: false
       swarm: false
-    - option: provenance
-      value_type: string
-      default_value: max
-      description: Set provenance mode (none|min|max)
-      deprecated: false
-      hidden: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
     - option: pull
       value_type: bool
       default_value: "false"

+ 1 - 1
pkg/api/api.go

@@ -160,7 +160,7 @@ type BuildOptions struct {
 	// Check let builder validate build configuration
 	Check bool
 	// Provenance
-	Provenance *string
+	Provenance bool
 }
 
 // Apply mutates project according to build options

+ 3 - 1
pkg/compose/build.go

@@ -482,7 +482,9 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
 	}
 
 	attests := map[string]*string{}
-	attests["provenance"] = options.Provenance
+	if !options.Provenance {
+		attests["provenance"] = nil
+	}
 
 	return build.Options{
 		Inputs: build.Inputs{