feat(build): add optional content-hash based build cache to skip rebuilding unchanged Dockerfiles

This commit is contained in:
2026-02-06 14:18:06 +00:00
parent 7131c16f80
commit cc83743f9a
6 changed files with 195 additions and 6 deletions

View File

@@ -77,4 +77,17 @@ export interface IBuildCommandOptions {
platform?: string; // Single platform override (e.g., 'linux/arm64')
timeout?: number; // Build timeout in seconds
noCache?: boolean; // Force rebuild without Docker layer cache (--no-cache)
cached?: boolean; // Skip builds when Dockerfile content hasn't changed
}
export interface ICacheEntry {
contentHash: string; // SHA-256 hex of Dockerfile content
imageId: string; // Docker image ID (sha256:...)
buildTag: string;
timestamp: number; // Unix ms
}
export interface ICacheData {
version: 1;
entries: { [cleanTag: string]: ICacheEntry };
}