@@ -542,6 +542,15 @@ export function dockerPreflightContainerNames(raw) {
542542 ) ;
543543}
544544
545+ export function resolveDockerPreflightPlatform ( arch = process . arch ) {
546+ return arch === "arm64" ? "linux/arm64" : "linux/amd64" ;
547+ }
548+
549+ export function dockerPreflightSmokeCommand ( arch = process . arch ) {
550+ const platform = resolveDockerPreflightPlatform ( arch ) ;
551+ return `docker run --rm --platform ${ shellQuote ( platform ) } alpine:3.20 true` ;
552+ }
553+
545554export function runShellCommand ( { command, env, label, logFile, timeoutMs, noOutputTimeoutMs } ) {
546555 return new Promise ( ( resolve ) => {
547556 const pipeOutput = Boolean ( logFile || noOutputTimeoutMs > 0 ) ;
@@ -873,15 +882,15 @@ async function runDockerPreflight(baseEnv, options) {
873882
874883 const startedAt = Date . now ( ) ;
875884 const run = await runShellCommand ( {
876- command : "docker run --rm alpine:3.20 true" ,
885+ command : dockerPreflightSmokeCommand ( ) ,
877886 env : baseEnv ,
878887 label : "docker-run-smoke" ,
879888 timeoutMs : options . runTimeoutMs ,
880889 } ) ;
881890 const elapsedSeconds = Math . round ( ( Date . now ( ) - startedAt ) / 1000 ) ;
882891 if ( run . status !== 0 ) {
883892 throw new Error (
884- `Docker preflight failed: docker run alpine:3.20 true status=${ run . status } elapsed=${ elapsedSeconds } s` ,
893+ `Docker preflight failed: ${ dockerPreflightSmokeCommand ( ) } status=${ run . status } elapsed=${ elapsedSeconds } s` ,
885894 ) ;
886895 }
887896 console . log ( `==> Docker preflight run: ${ elapsedSeconds } s` ) ;
0 commit comments