Commit 900c3f3
committed
feat: share host conda package cache with Docker containers
Mount the host's conda package cache directory read-only inside the
Docker build container. This allows the container to reuse cached
repodata and packages instead of re-downloading them from scratch.
Changes:
- Add _get_host_pkgs_dir() helper to locate the host's pkgs directory
- Add share_host_cache parameter to RecipeBuilder (default: True)
- Mount host pkgs dir as read-only volume in build_recipe()
- Update BUILD_SCRIPT_TEMPLATE to prepend the mounted cache to pkgs_dirs
- Add --no-share-host-cache CLI flag for opt-out
The :ro mount prevents any corruption of the host cache. Conda handles
read-only pkgs_dirs gracefully. If the host pkgs dir is not found, the
feature is silently skipped with no change in behavior.
Saves 30-90s per Docker build by avoiding redundant repodata downloads.1 parent 975acdb commit 900c3f3
2 files changed
+49
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
622 | 627 | | |
623 | 628 | | |
624 | 629 | | |
| |||
652 | 657 | | |
653 | 658 | | |
654 | 659 | | |
| 660 | + | |
655 | 661 | | |
656 | 662 | | |
657 | 663 | | |
| |||
694 | 700 | | |
695 | 701 | | |
696 | 702 | | |
| 703 | + | |
697 | 704 | | |
698 | 705 | | |
699 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
| |||
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
86 | 109 | | |
87 | 110 | | |
88 | 111 | | |
| |||
167 | 190 | | |
168 | 191 | | |
169 | 192 | | |
| 193 | + | |
170 | 194 | | |
171 | 195 | | |
172 | 196 | | |
| |||
248 | 272 | | |
249 | 273 | | |
250 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
251 | 279 | | |
252 | 280 | | |
253 | 281 | | |
| |||
295 | 323 | | |
296 | 324 | | |
297 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
298 | 337 | | |
299 | 338 | | |
300 | 339 | | |
| |||
479 | 518 | | |
480 | 519 | | |
481 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
482 | 524 | | |
483 | 525 | | |
484 | 526 | | |
| |||
0 commit comments