You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add --cache-from and --cache-to options to cartesi build
Expose Docker Buildx cache backend specs via two new repeatable CLI flags:
cartesi build --cache-from type=local,src=/tmp/cache \
--cache-to type=local,dest=/tmp/cache
The same options are also available per-drive in cartesi.toml:
[drives.root]
cache_from = ["type=gha"]
cache_to = ["type=gha,mode=max"]
CLI flags override the TOML values when non-empty.
Changes:
- config.ts: add cacheFrom/cacheTo fields to DockerDriveConfig and
defaultRootDriveConfig; parse cache_from/cache_to from TOML
- builder/docker.ts: thread cacheFrom/cacheTo through ImageBuildOptions
and append --cache-from / --cache-to args to the buildx invocation
- commands/build.ts: add --cache-from and --cache-to options (accumulator
style); merge into BuildContext and apply over per-drive config
- tests/unit/config.test.ts: add assertion for cache_from/cache_to parsing
- tests/integration/builder/docker.test.ts: add two integration tests —
one verifying the local cache directory is written, one verifying that
layers are recovered from a local cache after the daemon build cache is
pruned (attested by comparing root.ext2 SHA-256 between the two builds)
- tests/integration/builder/fixtures/Dockerfile.cache: new fixture using
a non-deterministic RUN date layer to make cache-hit vs miss detectable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments