mirror of
				https://github.com/docker/setup-qemu-action.git
				synced 2025-10-31 17:30:10 +08:00 
			
		
		
		
	switch to Docker exec
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									6ae1d4dea8
								
							
						
					
					
						commit
						31629f69bf
					
				
							
								
								
									
										10
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/main.ts
									
									
									
									
									
								
							| @ -1,8 +1,8 @@ | |||||||
| import * as context from './context'; | import * as context from './context'; | ||||||
| import * as core from '@actions/core'; | import * as core from '@actions/core'; | ||||||
| import * as actionsToolkit from '@docker/actions-toolkit'; | import * as actionsToolkit from '@docker/actions-toolkit'; | ||||||
|  | 
 | ||||||
| import {Docker} from '@docker/actions-toolkit/lib/docker/docker'; | import {Docker} from '@docker/actions-toolkit/lib/docker/docker'; | ||||||
| import {Exec} from '@docker/actions-toolkit/lib/exec'; |  | ||||||
| 
 | 
 | ||||||
| interface Platforms { | interface Platforms { | ||||||
|   supported: string[]; |   supported: string[]; | ||||||
| @ -20,7 +20,7 @@ actionsToolkit.run( | |||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     await core.group(`Pulling binfmt Docker image`, async () => { |     await core.group(`Pulling binfmt Docker image`, async () => { | ||||||
|       await Exec.getExecOutput('docker', ['pull', input.image], { |       await Docker.getExecOutput(['pull', input.image], { | ||||||
|         ignoreReturnCode: true |         ignoreReturnCode: true | ||||||
|       }).then(res => { |       }).then(res => { | ||||||
|         if (res.stderr.length > 0 && res.exitCode != 0) { |         if (res.stderr.length > 0 && res.exitCode != 0) { | ||||||
| @ -30,7 +30,7 @@ actionsToolkit.run( | |||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     await core.group(`Image info`, async () => { |     await core.group(`Image info`, async () => { | ||||||
|       await Exec.getExecOutput('docker', ['image', 'inspect', input.image], { |       await Docker.getExecOutput(['image', 'inspect', input.image], { | ||||||
|         ignoreReturnCode: true |         ignoreReturnCode: true | ||||||
|       }).then(res => { |       }).then(res => { | ||||||
|         if (res.stderr.length > 0 && res.exitCode != 0) { |         if (res.stderr.length > 0 && res.exitCode != 0) { | ||||||
| @ -40,7 +40,7 @@ actionsToolkit.run( | |||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     await core.group(`Installing QEMU static binaries`, async () => { |     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 |         ignoreReturnCode: true | ||||||
|       }).then(res => { |       }).then(res => { | ||||||
|         if (res.stderr.length > 0 && res.exitCode != 0) { |         if (res.stderr.length > 0 && res.exitCode != 0) { | ||||||
| @ -50,7 +50,7 @@ actionsToolkit.run( | |||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     await core.group(`Extracting available platforms`, async () => { |     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, |         ignoreReturnCode: true, | ||||||
|         silent: true |         silent: true | ||||||
|       }).then(res => { |       }).then(res => { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 CrazyMax
						CrazyMax