Switch to tonistiigi/binfmt

Add platforms input to choose what platforms to install

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-11 21:49:46 +02:00
parent 7e439a0132
commit b943609390
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 27 additions and 35 deletions

View file

@ -9,20 +9,11 @@ async function run(): Promise<void> {
return;
}
const qemuVer: string = core.getInput('qemu-version') || 'latest';
const image: string = core.getInput('image') || 'tonistiigi/binfmt:latest';
const platforms: string = core.getInput('platforms') || 'all';
core.info(`💎 Installing QEMU static binaries...`);
await exec.exec('docker', [
'run',
'--rm',
'--privileged',
`multiarch/qemu-user-static:${qemuVer}`,
'--reset',
'-p',
'yes',
'--credential',
'yes'
]);
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]);
} catch (error) {
core.setFailed(error.message);
}