mirror of
https://github.com/docker/build-push-action.git
synced 2024-11-27 13:19:03 +00:00
32 lines
678 B
TypeScript
32 lines
678 B
TypeScript
|
import * as os from 'os';
|
||
|
import * as core from '@actions/core';
|
||
|
import * as exec from '@actions/exec';
|
||
|
|
||
|
async function run(): Promise<void> {
|
||
|
try {
|
||
|
if (os.platform() !== 'linux') {
|
||
|
core.setFailed('Only supported on linux platform');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
const qemuVer: string = core.getInput('qemu-version') || 'latest';
|
||
|
|
||
|
core.info(`💎 Installing QEMU static binaries...`);
|
||
|
await exec.exec('docker', [
|
||
|
'run',
|
||
|
'--rm',
|
||
|
'--privileged',
|
||
|
`multiarch/qemu-user-static:${qemuVer}`,
|
||
|
'--reset',
|
||
|
'-p',
|
||
|
'yes',
|
||
|
'--credential',
|
||
|
'yes'
|
||
|
]);
|
||
|
} catch (error) {
|
||
|
core.setFailed(error.message);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
run();
|