hack: generate vtproto files for buildx

Integrates vtproto into buildx. The generated files dockerfile has been
modified to copy the buildkit equivalent file to ensure files are laid
out in the appropriate way for imports.

An import has also been included to change the grpc codec to the version
in buildkit that supports vtproto. This will allow buildx to utilize the
speed and memory improvements from that.

Also updates the gc control options for prune.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
Jonathan A. Sternberg
2024-10-08 13:35:06 -05:00
parent d353f5f6ba
commit 64c5139ab6
109 changed files with 68070 additions and 2941 deletions

View File

@ -89,7 +89,8 @@ type Client struct {
}
type SBOM struct {
Generator string
Generator string
Parameters map[string]string
}
type Source struct {
@ -257,17 +258,26 @@ func (bc *Client) init() error {
return err
}
if attrs, ok := attests[attestations.KeyTypeSbom]; ok {
src, ok := attrs["generator"]
if !ok {
params := make(map[string]string)
var ref reference.Named
for k, v := range attrs {
if k == "generator" {
ref, err = reference.ParseNormalizedNamed(v)
if err != nil {
return errors.Wrapf(err, "failed to parse sbom scanner %s", v)
}
ref = reference.TagNameOnly(ref)
} else {
params[k] = v
}
}
if ref == nil {
return errors.Errorf("sbom scanner cannot be empty")
}
ref, err := reference.ParseNormalizedNamed(src)
if err != nil {
return errors.Wrapf(err, "failed to parse sbom scanner %s", src)
}
ref = reference.TagNameOnly(ref)
bc.SBOM = &SBOM{
Generator: ref.String(),
Generator: ref.String(),
Parameters: params,
}
}