mirror of
https://github.com/docker/build-push-action.git
synced 2025-04-23 03:26:46 +00:00
Add setup-qemu action (#71)
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
36c90bc3ab
commit
64d53ac2cf
14 changed files with 5770 additions and 0 deletions
31
setup-qemu/src/main.ts
Normal file
31
setup-qemu/src/main.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
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();
|
Loading…
Add table
Add a link
Reference in a new issue