Skip to content

Commit

Permalink
switch to Docker exec
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jul 19, 2024
1 parent 6ae1d4d commit 31629f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as context from './context';
import * as core from '@actions/core';
import * as actionsToolkit from '@docker/actions-toolkit';

import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Exec} from '@docker/actions-toolkit/lib/exec';

interface Platforms {
supported: string[];
Expand All @@ -20,7 +20,7 @@ actionsToolkit.run(
});

await core.group(`Pulling binfmt Docker image`, async () => {
await Exec.getExecOutput('docker', ['pull', input.image], {
await Docker.getExecOutput(['pull', input.image], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
Expand All @@ -30,7 +30,7 @@ actionsToolkit.run(
});

await core.group(`Image info`, async () => {
await Exec.getExecOutput('docker', ['image', 'inspect', input.image], {
await Docker.getExecOutput(['image', 'inspect', input.image], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
Expand All @@ -40,7 +40,7 @@ actionsToolkit.run(
});

await core.group(`Installing QEMU static binaries`, async () => {
await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
Expand All @@ -50,7 +50,7 @@ actionsToolkit.run(
});

await core.group(`Extracting available platforms`, async () => {
await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image], {
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image], {
ignoreReturnCode: true,
silent: true
}).then(res => {
Expand Down

0 comments on commit 31629f6

Please sign in to comment.