Merge pull request #594 from samalba/disable-cache-mount

Disable cache mount
This commit is contained in:
Andrea Luzzardi 2021-06-09 10:23:02 -07:00 committed by GitHub
commit d19dd4d193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -456,11 +456,16 @@ func (p *Pipeline) mount(ctx context.Context, dest string, mnt *compiler.Value)
case "cache": case "cache":
return llb.AddMount( return llb.AddMount(
dest, dest,
llb.Scratch(), llb.Scratch().File(
llb.AsPersistentCacheDir( llb.Mkdir("/cache", fs.FileMode(0755)),
p.canonicalPath(mnt), llb.WithCustomName(p.vertexNamef("Mkdir /cache (cache mount %s)", dest)),
llb.CacheMountShared,
), ),
// FIXME: disabled persistent cache mount (gh issue #495)
// llb.Scratch(),
// llb.AsPersistentCacheDir(
// p.canonicalPath(mnt),
// llb.CacheMountShared,
// ),
), nil ), nil
case "tmpfs": case "tmpfs":
return llb.AddMount( return llb.AddMount(

View File

@ -113,10 +113,10 @@ import (
"\(dest)": o "\(dest)": o
// FIXME: support source path // FIXME: support source path
} }
for dest in cache { for dest, _ in cache {
"\(dest)": "cache" "\(dest)": "cache"
} }
for dest in tmpfs { for dest, _ in tmpfs {
"\(dest)": "tmpfs" "\(dest)": "tmpfs"
} }
} }