Make squashing optional

This commit is contained in:
Sebastian Grabowski 2024-04-27 01:38:16 +02:00
parent 7a95fa7ee0
commit 4a139d5a7a
No known key found for this signature in database
GPG key ID: 6030CFD8428BE75E
6 changed files with 22 additions and 10 deletions

View file

@ -266,6 +266,7 @@ async function doBuildFromScratch(
const workingDir = core.getInput(Inputs.WORKDIR);
const envs = getInputList(Inputs.ENVS);
const tlsVerify = core.getInput(Inputs.TLS_VERIFY) === "true";
const squash = core.getInput(Inputs.SQUASH) === "true";
const container = await cli.from(baseImage, tlsVerify, extraArgs);
const containerId = container.output.replace("\n", "");
@ -287,7 +288,7 @@ async function doBuildFromScratch(
};
await cli.config(containerId, newImageConfig);
await cli.copy(containerId, content);
await cli.commit(containerId, `${newImage}${tagSuffix}`, useOCI);
await cli.commit(containerId, `${newImage}${tagSuffix}`, useOCI, squash);
builtImage.push(`${newImage}${tagSuffix}`);
}
}
@ -301,7 +302,7 @@ async function doBuildFromScratch(
};
await cli.config(containerId, newImageConfig);
await cli.copy(containerId, content);
await cli.commit(containerId, newImage, useOCI);
await cli.commit(containerId, newImage, useOCI, squash);
builtImage.push(newImage);
}