| 用途 | 镜像自带缓存元数据 |
|---|---|
| 语法 | --build-arg BUILDKIT_INLINE_CACHE=1 + --cache-from 镜像 |
| 对比 | 相比独立缓存 tag 更省管理成本 |
示例
示例
docker buildx build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from registry.example.com/app/web:1.0 \
--push -t registry.example.com/app/web:1.0 .适合层结构简单、镜像本身就是主要缓存的场景;多阶段项目通常配合 registry 缓存更稳。