mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 00:00:40 +00:00
feat: add option to configure provenance attestation (#171)
This commit is contained in:
parent
6278d55b41
commit
13e353b883
@ -255,3 +255,8 @@ properties:
|
|||||||
description: Labels to add to the image.
|
description: Labels to add to the image.
|
||||||
type: list
|
type: list
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
- name: provenance
|
||||||
|
description: Generate [provenance](https://docs.docker.com/build/attestations/slsa-provenance/) attestation for the build (shorthand for `--attest=type=provenance`).
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
@ -305,5 +305,12 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
|
|||||||
Destination: &settings.Build.Labels,
|
Destination: &settings.Build.Labels,
|
||||||
Category: category,
|
Category: category,
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "provenance",
|
||||||
|
EnvVars: []string{"PLUGIN_PROVENANCE"},
|
||||||
|
Usage: "generates provenance attestation for the build",
|
||||||
|
Destination: &settings.Build.Provenance,
|
||||||
|
Category: category,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,10 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
|
|||||||
args = append(args, "--label", arg)
|
args = append(args, "--label", arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if build.Provenance != "" {
|
||||||
|
args = append(args, "--provenance", build.Provenance)
|
||||||
|
}
|
||||||
|
|
||||||
return exec.Command(dockerExe, args...)
|
return exec.Command(dockerExe, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ type Build struct {
|
|||||||
Output string // Docker build output folder
|
Output string // Docker build output folder
|
||||||
NamedContext cli.StringSlice // Docker build named context
|
NamedContext cli.StringSlice // Docker build named context
|
||||||
Labels cli.StringSlice // Docker build labels
|
Labels cli.StringSlice // Docker build labels
|
||||||
|
Provenance string // Docker build provenance attestation
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings for the Plugin.
|
// Settings for the Plugin.
|
||||||
|
Loading…
Reference in New Issue
Block a user