Skip to content

Commit

Permalink
core: replaced persistent cache mounts with directory
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Alba <sam.alba@gmail.com>
  • Loading branch information
samalba committed Jun 9, 2021
1 parent b41adbd commit 09617b8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions environment/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,16 @@ func (p *Pipeline) mount(ctx context.Context, dest string, mnt *compiler.Value)
case "cache":
return llb.AddMount(
dest,
llb.Scratch(),
llb.AsPersistentCacheDir(
p.canonicalPath(mnt),
llb.CacheMountShared,
llb.Scratch().File(
llb.Mkdir("/cache", fs.FileMode(0755)),
llb.WithCustomName(p.vertexNamef("Mkdir /cache (cache mount %s)", dest)),
),
// FIXME: disabled persistent cache mount (gh issue #495)
// llb.Scratch(),
// llb.AsPersistentCacheDir(
// p.canonicalPath(mnt),
// llb.CacheMountShared,
// ),
), nil
case "tmpfs":
return llb.AddMount(
Expand Down

0 comments on commit 09617b8

Please sign in to comment.