diff --git a/pkg/cli/build-minirootfs.go b/pkg/cli/build-minirootfs.go index c7877bc84..179667297 100644 --- a/pkg/cli/build-minirootfs.go +++ b/pkg/cli/build-minirootfs.go @@ -27,6 +27,7 @@ import ( func BuildMinirootFS() *cobra.Command { var useProot bool var buildDate string + var sbomPath string cmd := &cobra.Command{ Use: "build-minirootfs", @@ -40,12 +41,14 @@ func BuildMinirootFS() *cobra.Command { build.WithTarball(args[1]), build.WithProot(useProot), build.WithBuildDate(buildDate), + build.WithSBOM(sbomPath), ) }, } cmd.Flags().BoolVar(&useProot, "use-proot", false, "use proot to simulate privileged operations") cmd.Flags().StringVar(&buildDate, "build-date", "", "date used for the timestamps of the files inside the image") + cmd.Flags().StringVar(&sbomPath, "sbom-path", "", "generate an SBOM") return cmd } diff --git a/pkg/cli/build.go b/pkg/cli/build.go index 652b7791d..083fc8fc6 100644 --- a/pkg/cli/build.go +++ b/pkg/cli/build.go @@ -28,6 +28,7 @@ import ( func Build() *cobra.Command { var useProot bool var buildDate string + var sbomPath string cmd := &cobra.Command{ Use: "build", @@ -45,12 +46,14 @@ command, e.g. build.WithConfig(args[0]), build.WithProot(useProot), build.WithBuildDate(buildDate), + build.WithSBOM(sbomPath), ) }, } cmd.Flags().BoolVar(&useProot, "use-proot", false, "use proot to simulate privileged operations") cmd.Flags().StringVar(&buildDate, "build-date", "", "date used for the timestamps of the files inside the image") + cmd.Flags().StringVar(&sbomPath, "sbom-path", "", "generate an SBOM") return cmd } diff --git a/pkg/cli/publish.go b/pkg/cli/publish.go index 9095e83c2..0dfcbd673 100644 --- a/pkg/cli/publish.go +++ b/pkg/cli/publish.go @@ -30,6 +30,7 @@ func Publish() *cobra.Command { var imageRefs string var useProot bool var buildDate string + var sbomPath string cmd := &cobra.Command{ Use: "publish", @@ -46,6 +47,7 @@ in a keychain.`, build.WithProot(useProot), build.WithTags(args[1:]...), build.WithBuildDate(buildDate), + build.WithSBOM(sbomPath), ) if err != nil { return err @@ -57,6 +59,7 @@ in a keychain.`, cmd.Flags().StringVar(&imageRefs, "image-refs", "", "path to file where a list of the published image references will be written") cmd.Flags().BoolVar(&useProot, "use-proot", false, "use proot to simulate privileged operations") cmd.Flags().StringVar(&buildDate, "build-date", "", "date used for the timestamps of the files inside the image") + cmd.Flags().StringVar(&sbomPath, "sbom-path", "", "generate an SBOM") return cmd }