Commit 1d9918b
committed
docker: Build with persistent cache
Cache downloaded and generated files with `RUN --mount=type=cache', so
that later builds don't need to download and build everything from
scratch.
Some Docker versions could run into bugs when a later stage accesses a
cached directory from previous stages, so copy the binaries into a
separate directory first. Doing so also allows Stage 2 to merge multiple
`COPY --from=builder' steps into a single one.
Link: https://docs.docker.com/build/cache/optimize/#use-cache-mounts
Signed-off-by: Rong Zhang <i@rong.moe>1 parent 8198f26 commit 1d9918b
1 file changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
| |||
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
0 commit comments