1
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2025-06-28 00:06:42 +02:00

check if driver compatible with keep-state

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2025-06-13 18:06:00 +02:00
parent 4143b5899b
commit 36590ad0c1
No known key found for this signature in database
GPG key ID: ADE44D8C9D44FBE4
4 changed files with 33 additions and 29 deletions

View file

@ -28,6 +28,12 @@ actionsToolkit.run(
const standalone = await toolkit.buildx.isStandalone();
stateHelper.setStandalone(standalone);
if (inputs.keepState && inputs.driver !== 'docker-container') {
// https://docs.docker.com/reference/cli/docker/buildx/rm/#keep-state
throw new Error(`Cannot use keep-state with ${inputs.driver} driver`);
}
stateHelper.setKeepState(inputs.keepState);
await core.group(`Docker info`, async () => {
try {
await Docker.printVersion();
@ -115,7 +121,6 @@ actionsToolkit.run(
});
}
}
stateHelper.setKeepState(inputs.keepState);
if (inputs.driver !== 'docker') {
await core.group(`Creating a new builder instance`, async () => {