mirror of
https://github.com/docker/buildx.git
synced 2024-11-22 15:37:16 +08:00
build: send buildinfo dependencies
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
893d505803
commit
7677052cb7
@ -32,6 +32,7 @@ import (
|
||||
"github.com/docker/docker/pkg/urlutil"
|
||||
"github.com/moby/buildkit/client"
|
||||
"github.com/moby/buildkit/client/llb"
|
||||
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
||||
gateway "github.com/moby/buildkit/frontend/gateway/client"
|
||||
"github.com/moby/buildkit/session"
|
||||
"github.com/moby/buildkit/session/upload/uploadprovider"
|
||||
@ -1218,15 +1219,20 @@ func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *c
|
||||
}
|
||||
so.FrontendInputs[k+"::"+platform] = st
|
||||
so.FrontendAttrs[v+"::"+platform] = "input:" + k + "::" + platform
|
||||
dt, ok := rr.Metadata["containerimage.config/"+platform]
|
||||
if !ok {
|
||||
continue
|
||||
metadata := make(map[string][]byte)
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterImageConfigKey+"/"+platform]; ok {
|
||||
metadata[exptypes.ExporterImageConfigKey] = dt
|
||||
}
|
||||
dt, err = json.Marshal(map[string][]byte{"containerimage.config": dt})
|
||||
if err != nil {
|
||||
return err
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterBuildInfo+"/"+platform]; ok {
|
||||
metadata[exptypes.ExporterBuildInfo] = dt
|
||||
}
|
||||
if len(metadata) > 0 {
|
||||
dt, err := json.Marshal(metadata)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendAttrs["input-metadata:"+k+"::"+platform] = string(dt)
|
||||
}
|
||||
so.FrontendAttrs["input-metadata:"+k+"::"+platform] = string(dt)
|
||||
}
|
||||
}
|
||||
if rr.Ref != nil {
|
||||
@ -1236,8 +1242,15 @@ func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *c
|
||||
}
|
||||
so.FrontendInputs[k] = st
|
||||
so.FrontendAttrs[v] = "input:" + k
|
||||
if dt, ok := rr.Metadata["containerimage.config"]; ok {
|
||||
dt, err = json.Marshal(map[string][]byte{"containerimage.config": dt})
|
||||
metadata := make(map[string][]byte)
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterImageConfigKey]; ok {
|
||||
metadata[exptypes.ExporterImageConfigKey] = dt
|
||||
}
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterBuildInfo]; ok {
|
||||
metadata[exptypes.ExporterBuildInfo] = dt
|
||||
}
|
||||
if len(metadata) > 0 {
|
||||
dt, err := json.Marshal(metadata)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
28
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
Normal file
28
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
package exptypes
|
||||
|
||||
import (
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
ExporterConfigDigestKey = "config.digest"
|
||||
ExporterImageDigestKey = "containerimage.digest"
|
||||
ExporterImageConfigKey = "containerimage.config"
|
||||
ExporterImageConfigDigestKey = "containerimage.config.digest"
|
||||
ExporterImageDescriptorKey = "containerimage.descriptor"
|
||||
ExporterInlineCache = "containerimage.inlinecache"
|
||||
ExporterBuildInfo = "containerimage.buildinfo"
|
||||
ExporterPlatformsKey = "refs.platforms"
|
||||
)
|
||||
|
||||
const EmptyGZLayer = digest.Digest("sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1")
|
||||
|
||||
type Platforms struct {
|
||||
Platforms []Platform
|
||||
}
|
||||
|
||||
type Platform struct {
|
||||
ID string
|
||||
Platform ocispecs.Platform
|
||||
}
|
1
vendor/modules.txt
vendored
1
vendor/modules.txt
vendored
@ -303,6 +303,7 @@ github.com/moby/buildkit/client/connhelper
|
||||
github.com/moby/buildkit/client/llb
|
||||
github.com/moby/buildkit/client/ociindex
|
||||
github.com/moby/buildkit/cmd/buildkitd/config
|
||||
github.com/moby/buildkit/exporter/containerimage/exptypes
|
||||
github.com/moby/buildkit/frontend/gateway/client
|
||||
github.com/moby/buildkit/frontend/gateway/grpcclient
|
||||
github.com/moby/buildkit/frontend/gateway/pb
|
||||
|
Loading…
Reference in New Issue
Block a user