Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable cache on feature build when --build-no-cache is passed #790

Merged
5 changes: 4 additions & 1 deletion src/spec-node/containerFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function extendImage(params: DockerResolverParameters, config: Subs
args.push('--load'); // (short for --output=docker, i.e. load into normal 'docker images' collection)
}
}
if (params.buildxCacheTo) {
if (params.buildxCacheTo && !params.buildNoCache) {
samruddhikhandale marked this conversation as resolved.
Show resolved Hide resolved
args.push('--cache-to', params.buildxCacheTo);
}

Expand All @@ -95,6 +95,9 @@ export async function extendImage(params: DockerResolverParameters, config: Subs
'build',
);
}
if (params.buildNoCache) {
args.push('--no-cache');
}
for (const buildArg in featureBuildInfo.buildArgs) {
args.push('--build-arg', `${buildArg}=${featureBuildInfo.buildArgs[buildArg]}`);
}
Expand Down