Skip to content

Commit

Permalink
Fix: propagate --cache-from to buildx build
Browse files Browse the repository at this point in the history
  • Loading branch information
dhhyi committed Oct 10, 2023
1 parent d2c1bc8 commit cbd9869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/spec-node/containerFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export async function extendImage(params: DockerResolverParameters, config: Subs
if (params.buildxCacheTo) {
args.push('--cache-to', params.buildxCacheTo);
}
if (params.additionalCacheFroms) {
params.additionalCacheFroms.forEach(cacheFrom => args.push('--cache-from', cacheFrom));
}

for (const buildContext in featureBuildInfo.buildKitContexts) {
args.push('--build-context', `${buildContext}=${featureBuildInfo.buildKitContexts[buildContext]}`);
Expand Down
3 changes: 3 additions & 0 deletions src/spec-node/singleContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ async function buildAndExtendImage(buildParams: DockerResolverParameters, config
if (buildParams.buildxCacheTo) {
args.push('--cache-to', buildParams.buildxCacheTo);
}
if (buildParams.additionalCacheFroms) {
buildParams.additionalCacheFroms.forEach(cacheFrom => args.push('--cache-from', cacheFrom));
}
args.push('--build-arg', 'BUILDKIT_INLINE_CACHE=1');
} else {
args.push('build');
Expand Down

0 comments on commit cbd9869

Please sign in to comment.