Skip to content

Commit

Permalink
Set mode=max to cache intermediate stages
Browse files Browse the repository at this point in the history
buildx caches layer only in the final stage by default.
To speedup multi-stage Dockerfile build, better to set `mode=max`: https://docs.docker.com/engine/reference/commandline/buildx_build/#cache-to
  • Loading branch information
saiya committed May 28, 2021
1 parent ad44023 commit 53f31be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
push: true
tags: user/app:latest
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline
cache-to: type=inline,mode=max
```

## GitHub cache
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
push: true
tags: user/app:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
-
# Temp fix
# https://github.com/docker/build-push-action/issues/252
Expand Down

0 comments on commit 53f31be

Please sign in to comment.