mirror of
https://github.com/docker/setup-qemu-action.git
synced 2025-08-17 08:09:52 +08:00
cache-image input to enable/disable caching of binfmt image
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -4,11 +4,13 @@ import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
export interface Inputs {
|
||||
image: string;
|
||||
platforms: string;
|
||||
cacheImage: boolean;
|
||||
}
|
||||
|
||||
export function getInputs(): Inputs {
|
||||
return {
|
||||
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: Util.getInputList('platforms').join(',') || 'all'
|
||||
platforms: Util.getInputList('platforms').join(',') || 'all',
|
||||
cacheImage: core.getBooleanInput('cache-image')
|
||||
};
|
||||
}
|
||||
|
@@ -20,13 +20,7 @@ actionsToolkit.run(
|
||||
});
|
||||
|
||||
await core.group(`Pulling binfmt Docker image`, async () => {
|
||||
await Docker.getExecOutput(['pull', input.image], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
await Docker.pull(input.image, input.cacheImage);
|
||||
});
|
||||
|
||||
await core.group(`Image info`, async () => {
|
||||
|
Reference in New Issue
Block a user