1
1
import * as context from './context' ;
2
2
import * as core from '@actions/core' ;
3
3
import * as actionsToolkit from '@docker/actions-toolkit' ;
4
+
4
5
import { Docker } from '@docker/actions-toolkit/lib/docker/docker' ;
5
- import { Exec } from '@docker/actions-toolkit/lib/exec' ;
6
6
7
7
interface Platforms {
8
8
supported : string [ ] ;
@@ -20,7 +20,7 @@ actionsToolkit.run(
20
20
} ) ;
21
21
22
22
await core . group ( `Pulling binfmt Docker image` , async ( ) => {
23
- await Exec . getExecOutput ( 'docker' , [ 'pull' , input . image ] , {
23
+ await Docker . getExecOutput ( [ 'pull' , input . image ] , {
24
24
ignoreReturnCode : true
25
25
} ) . then ( res => {
26
26
if ( res . stderr . length > 0 && res . exitCode != 0 ) {
@@ -30,7 +30,7 @@ actionsToolkit.run(
30
30
} ) ;
31
31
32
32
await core . group ( `Image info` , async ( ) => {
33
- await Exec . getExecOutput ( 'docker' , [ 'image' , 'inspect' , input . image ] , {
33
+ await Docker . getExecOutput ( [ 'image' , 'inspect' , input . image ] , {
34
34
ignoreReturnCode : true
35
35
} ) . then ( res => {
36
36
if ( res . stderr . length > 0 && res . exitCode != 0 ) {
@@ -40,7 +40,7 @@ actionsToolkit.run(
40
40
} ) ;
41
41
42
42
await core . group ( `Installing QEMU static binaries` , async ( ) => {
43
- await Exec . getExecOutput ( 'docker' , [ 'run' , '--rm' , '--privileged' , input . image , '--install' , input . platforms ] , {
43
+ await Docker . getExecOutput ( [ 'run' , '--rm' , '--privileged' , input . image , '--install' , input . platforms ] , {
44
44
ignoreReturnCode : true
45
45
} ) . then ( res => {
46
46
if ( res . stderr . length > 0 && res . exitCode != 0 ) {
@@ -50,7 +50,7 @@ actionsToolkit.run(
50
50
} ) ;
51
51
52
52
await core . group ( `Extracting available platforms` , async ( ) => {
53
- await Exec . getExecOutput ( 'docker' , [ 'run' , '--rm' , '--privileged' , input . image ] , {
53
+ await Docker . getExecOutput ( [ 'run' , '--rm' , '--privileged' , input . image ] , {
54
54
ignoreReturnCode : true ,
55
55
silent : true
56
56
} ) . then ( res => {
0 commit comments