Skip to content

Commit 333cf71

Browse files
committed
use caching for gha
1 parent f9b9800 commit 333cf71

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

framework/docker.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,17 @@ func BuildImageOnce(once *sync.Once, dctx, dfile, nameAndTag string) error {
265265
var err error
266266
once.Do(func() {
267267
dfilePath := filepath.Join(dctx, dfile)
268-
err = runCommand("docker", "build", "-t", nameAndTag, "-f", dfilePath, dctx)
268+
err = runCommand(
269+
"docker",
270+
"build",
271+
"--cache-from=type=gha,scope=tmp-cache-ctf",
272+
"--cache-to=type=gha,scope=tmp-cache-ctf,mode=max",
273+
"-t",
274+
nameAndTag,
275+
"-f",
276+
dfilePath,
277+
dctx,
278+
)
269279
if err != nil {
270280
err = fmt.Errorf("failed to build Docker image: %w", err)
271281
}

0 commit comments

Comments
 (0)