support path option in script/component mounts
Signed-off-by: Tony Worm <tony@hofstadter.io>
This commit is contained in:
parent
622de21883
commit
8de7a47b8d
@ -43,6 +43,7 @@ func (mnt *Mount) LLB(ctx context.Context, s Solver) (llb.RunOption, error) {
|
|||||||
llb.CacheMountShared,
|
llb.CacheMountShared,
|
||||||
)), nil
|
)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute source component or script, discarding fs writes & output value
|
// Compute source component or script, discarding fs writes & output value
|
||||||
from, err := newExecutable(mnt.v.Lookup("from"))
|
from, err := newExecutable(mnt.v.Lookup("from"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -52,5 +53,17 @@ func (mnt *Mount) LLB(ctx context.Context, s Solver) (llb.RunOption, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return llb.AddMount(mnt.dest, fromFS.LLB()), nil
|
|
||||||
|
// possibly construct mount options for LLB from
|
||||||
|
var mo []llb.MountOption
|
||||||
|
// handle "path" option
|
||||||
|
if p := mnt.v.Lookup("path"); p.Exists() {
|
||||||
|
ps, err := p.String()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
mo = append(mo, llb.SourcePath(ps))
|
||||||
|
}
|
||||||
|
|
||||||
|
return llb.AddMount(mnt.dest, fromFS.LLB(), mo...), nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user