buildctl: allow import-cache on frontend builds

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2018-11-20 16:35:53 -08:00
parent bf8c057e68
commit 478f417eb8
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 {