Skip to content

Commit 76a2c8f

Browse files
committed
fix: use single build directory
This way build directory is shared between multiple steps (if any). Signed-off-by: Andrey Smirnov <[email protected]>
1 parent 62ed470 commit 76a2c8f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/pkg/convert/node.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
)
2525

2626
const (
27-
tmpDirTemplate = "/tmp/build/%d"
28-
pkgDir = "/pkg"
27+
tmpDir = "/tmp/build"
28+
pkgDir = "/pkg"
2929
)
3030

3131
func defaultCopyOptions(options *environment.Options, reproducible bool) *llb.CopyInfo {
@@ -197,9 +197,9 @@ func (node *NodeLLB) dependencies(ctx context.Context, root llb.State) (llb.Stat
197197
return root.WithOutput(llb.Merge(stages, llb.WithCustomName(node.Prefix+"copy")).Output()), nil
198198
}
199199

200-
func (node *NodeLLB) stepTmpDir(root llb.State, i int, step *v1alpha2.Step) llb.State {
200+
func (node *NodeLLB) stepTmpDir(root llb.State, step *v1alpha2.Step) llb.State {
201201
if step.TmpDir == "" {
202-
step.TmpDir = fmt.Sprintf(tmpDirTemplate, i)
202+
step.TmpDir = tmpDir
203203
}
204204

205205
return root.File(
@@ -319,7 +319,7 @@ func (node *NodeLLB) stepScripts(root llb.State, i int, step v1alpha2.Step) llb.
319319
}
320320

321321
func (node *NodeLLB) step(root llb.State, i int, step v1alpha2.Step) llb.State {
322-
root = node.stepTmpDir(root, i, &step)
322+
root = node.stepTmpDir(root, &step)
323323
root = node.stepDownload(root, step)
324324
root = node.stepEnvironment(root, step)
325325
root = node.stepScripts(root, i, step)

0 commit comments

Comments
 (0)