From 2078cdfdec1be23a264371b3a030896b966d2d4e Mon Sep 17 00:00:00 2001 From: Jan Bicker Date: Thu, 28 Nov 2024 13:44:14 +0100 Subject: [PATCH] On darwin/arm64 force to use amd64 image --- .../main-container-creation-contributions.ts | 5 ++++- .../remote/src/electron-node/setup/remote-setup-service.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/dev-container/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts b/packages/dev-container/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts index ad0d0d4d265de..8d724cc537847 100644 --- a/packages/dev-container/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts +++ b/packages/dev-container/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts @@ -37,7 +37,10 @@ export class ImageFileContribution implements ContainerCreationContribution { async handleContainerCreation(createOptions: Docker.ContainerCreateOptions, containerConfig: ImageContainer, api: Docker, outputprovider: ContainerOutputProvider): Promise { if (containerConfig.image) { - await new Promise((res, rej) => api.pull(containerConfig.image, {}, (err, stream) => { + const platform = process.platform; + const arch = process.arch; + const options = platform === 'darwin' && arch === 'arm64' ? { platform: 'amd64' } : {}; + await new Promise((res, rej) => api.pull(containerConfig.image, options, (err, stream) => { if (err) { rej(err); } else { diff --git a/packages/remote/src/electron-node/setup/remote-setup-service.ts b/packages/remote/src/electron-node/setup/remote-setup-service.ts index 9ef150807d985..2fe643c26d843 100644 --- a/packages/remote/src/electron-node/setup/remote-setup-service.ts +++ b/packages/remote/src/electron-node/setup/remote-setup-service.ts @@ -167,6 +167,8 @@ export class RemoteSetupService { arch = 'x64'; } else if (archResult.match(/i\d83/)) { // i386, i483, i683 arch = 'x86'; + } else if (archResult.includes('aarch64')) { + arch = 'arm64'; } else { arch = archResult.trim(); }