mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-21 19:27:46 +08:00
Merge pull request #2558 from tonistiigi/fix-sharedkey-for-context
build: fix sharedkey computation for local context
This commit is contained in:
commit
9358c45b46
13
build/opt.go
13
build/opt.go
@ -272,11 +272,9 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
|
|||||||
}
|
}
|
||||||
defers = append(defers, releaseLoad)
|
defers = append(defers, releaseLoad)
|
||||||
|
|
||||||
if sharedKey := so.LocalDirs["context"]; sharedKey != "" {
|
// add node identifier to shared key if one was specified
|
||||||
if p, err := filepath.Abs(sharedKey); err == nil {
|
if so.SharedKey != "" {
|
||||||
sharedKey = filepath.Base(p)
|
so.SharedKey += ":" + confutil.TryNodeIdentifier(configDir)
|
||||||
}
|
|
||||||
so.SharedKey = sharedKey + ":" + confutil.TryNodeIdentifier(configDir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if opt.Pull {
|
if opt.Pull {
|
||||||
@ -416,6 +414,11 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
|||||||
if err := setLocalMount("context", inp.ContextPath, target, addVCSLocalDir); err != nil {
|
if err := setLocalMount("context", inp.ContextPath, target, addVCSLocalDir); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
sharedKey := inp.ContextPath
|
||||||
|
if p, err := filepath.Abs(sharedKey); err == nil {
|
||||||
|
sharedKey = filepath.Base(p)
|
||||||
|
}
|
||||||
|
target.SharedKey = sharedKey
|
||||||
switch inp.DockerfilePath {
|
switch inp.DockerfilePath {
|
||||||
case "-":
|
case "-":
|
||||||
dockerfileReader = inp.InStream
|
dockerfileReader = inp.InStream
|
||||||
|
Loading…
x
Reference in New Issue
Block a user