Merge pull request #731 from tonistiigi/buildctl-import-cache

buildctl: allow import-cache on frontend builds
docker-18.09
Akihiro Suda 2018-11-21 12:33:36 +09:00 committed by GitHub
commit df642989fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -221,6 +221,10 @@ func build(clicontext *cli.Context) error {
solveOpt.FrontendAttrs["no-cache"] = "" solveOpt.FrontendAttrs["no-cache"] = ""
} }
if clicontext.String("frontend") != "" && len(clicontext.StringSlice("import-cache")) != 0 {
solveOpt.FrontendAttrs["cache-from"] = strings.Join(clicontext.StringSlice("import-cache"), ",")
}
eg.Go(func() error { eg.Go(func() error {
resp, err := c.Solve(ctx, def, solveOpt, ch) resp, err := c.Solve(ctx, def, solveOpt, ch)
if err != nil { if err != nil {