mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 664c2b469f19
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
10
vendor/github.com/moby/buildkit/frontend/dockerui/attr.go
generated
vendored
10
vendor/github.com/moby/buildkit/frontend/dockerui/attr.go
generated
vendored
@ -125,6 +125,16 @@ func parseSourceDateEpoch(v string) (*time.Time, error) {
|
||||
return &tm, nil
|
||||
}
|
||||
|
||||
func parseLocalSessionIDs(opt map[string]string) map[string]string {
|
||||
m := map[string]string{}
|
||||
for k, v := range opt {
|
||||
if strings.HasPrefix(k, localSessionIDPrefix) {
|
||||
m[strings.TrimPrefix(k, localSessionIDPrefix)] = v
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func filter(opt map[string]string, key string) map[string]string {
|
||||
m := map[string]string{}
|
||||
for k, v := range opt {
|
||||
|
37
vendor/github.com/moby/buildkit/frontend/dockerui/config.go
generated
vendored
37
vendor/github.com/moby/buildkit/frontend/dockerui/config.go
generated
vendored
@ -26,8 +26,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
buildArgPrefix = "build-arg:"
|
||||
labelPrefix = "label:"
|
||||
buildArgPrefix = "build-arg:"
|
||||
labelPrefix = "label:"
|
||||
localSessionIDPrefix = "local-sessionid:"
|
||||
|
||||
keyTarget = "target"
|
||||
keyCgroupParent = "cgroup-parent"
|
||||
@ -79,10 +80,11 @@ type Config struct {
|
||||
|
||||
type Client struct {
|
||||
Config
|
||||
client client.Client
|
||||
ignoreCache []string
|
||||
g flightcontrol.CachedGroup[*buildContext]
|
||||
bopts client.BuildOpts
|
||||
client client.Client
|
||||
ignoreCache []string
|
||||
g flightcontrol.CachedGroup[*buildContext]
|
||||
bopts client.BuildOpts
|
||||
localsSessionIDs map[string]string
|
||||
|
||||
dockerignore []byte
|
||||
dockerignoreName string
|
||||
@ -298,6 +300,9 @@ func (bc *Client) init() error {
|
||||
return errors.Wrapf(err, "failed to parse %s", keyCopyIgnoredCheckEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
bc.localsSessionIDs = parseLocalSessionIDs(opts)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -331,9 +336,14 @@ func (bc *Client) ReadEntrypoint(ctx context.Context, lang string, opts ...llb.L
|
||||
filenames = append(filenames, path.Join(path.Dir(bctx.filename), strings.ToLower(DefaultDockerfileName)))
|
||||
}
|
||||
|
||||
sessionID := bc.bopts.SessionID
|
||||
if v, ok := bc.localsSessionIDs[bctx.dockerfileLocalName]; ok {
|
||||
sessionID = v
|
||||
}
|
||||
|
||||
opts = append([]llb.LocalOption{
|
||||
llb.FollowPaths(filenames),
|
||||
llb.SessionID(bc.bopts.SessionID),
|
||||
llb.SessionID(sessionID),
|
||||
llb.SharedKeyHint(bctx.dockerfileLocalName),
|
||||
WithInternalName(name),
|
||||
llb.Differ(llb.DiffNone, false),
|
||||
@ -427,8 +437,13 @@ func (bc *Client) MainContext(ctx context.Context, opts ...llb.LocalOption) (*ll
|
||||
return nil, errors.Wrapf(err, "failed to read dockerignore patterns")
|
||||
}
|
||||
|
||||
sessionID := bc.bopts.SessionID
|
||||
if v, ok := bc.localsSessionIDs[bctx.contextLocalName]; ok {
|
||||
sessionID = v
|
||||
}
|
||||
|
||||
opts = append([]llb.LocalOption{
|
||||
llb.SessionID(bc.bopts.SessionID),
|
||||
llb.SessionID(sessionID),
|
||||
llb.ExcludePatterns(excludes),
|
||||
llb.SharedKeyHint(bctx.contextLocalName),
|
||||
WithInternalName("load build context"),
|
||||
@ -500,8 +515,12 @@ func WithInternalName(name string) llb.ConstraintsOpt {
|
||||
|
||||
func (bc *Client) dockerIgnorePatterns(ctx context.Context, bctx *buildContext) ([]string, error) {
|
||||
if bc.dockerignore == nil {
|
||||
sessionID := bc.bopts.SessionID
|
||||
if v, ok := bc.localsSessionIDs[bctx.contextLocalName]; ok {
|
||||
sessionID = v
|
||||
}
|
||||
st := llb.Local(bctx.contextLocalName,
|
||||
llb.SessionID(bc.bopts.SessionID),
|
||||
llb.SessionID(sessionID),
|
||||
llb.FollowPaths([]string{DefaultDockerignoreName}),
|
||||
llb.SharedKeyHint(bctx.contextLocalName+"-"+DefaultDockerignoreName),
|
||||
WithInternalName("load "+DefaultDockerignoreName),
|
||||
|
8
vendor/github.com/moby/buildkit/frontend/dockerui/namedcontext.go
generated
vendored
8
vendor/github.com/moby/buildkit/frontend/dockerui/namedcontext.go
generated
vendored
@ -187,8 +187,12 @@ func (bc *Client) namedContextRecursive(ctx context.Context, name string, nameWi
|
||||
}
|
||||
return &st, &img, nil
|
||||
case "local":
|
||||
sessionID := bc.bopts.SessionID
|
||||
if v, ok := bc.localsSessionIDs[vv[1]]; ok {
|
||||
sessionID = v
|
||||
}
|
||||
st := llb.Local(vv[1],
|
||||
llb.SessionID(bc.bopts.SessionID),
|
||||
llb.SessionID(sessionID),
|
||||
llb.FollowPaths([]string{DefaultDockerignoreName}),
|
||||
llb.SharedKeyHint("context:"+nameWithPlatform+"-"+DefaultDockerignoreName),
|
||||
llb.WithCustomName("[context "+nameWithPlatform+"] load "+DefaultDockerignoreName),
|
||||
@ -226,7 +230,7 @@ func (bc *Client) namedContextRecursive(ctx context.Context, name string, nameWi
|
||||
localOutput := &asyncLocalOutput{
|
||||
name: vv[1],
|
||||
nameWithPlatform: nameWithPlatform,
|
||||
sessionID: bc.bopts.SessionID,
|
||||
sessionID: sessionID,
|
||||
excludes: excludes,
|
||||
extraOpts: opt.AsyncLocalOpts,
|
||||
}
|
||||
|
Reference in New Issue
Block a user