Skip to content

Commit

Permalink
On darwin/arm64 force to use amd64 image
Browse files Browse the repository at this point in the history
  • Loading branch information
jbicker committed Nov 29, 2024
1 parent 689bd51 commit 2078cdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export class ImageFileContribution implements ContainerCreationContribution {
async handleContainerCreation(createOptions: Docker.ContainerCreateOptions, containerConfig: ImageContainer,
api: Docker, outputprovider: ContainerOutputProvider): Promise<void> {
if (containerConfig.image) {
await new Promise<void>((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<void>((res, rej) => api.pull(containerConfig.image, options, (err, stream) => {
if (err) {
rej(err);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 2078cdf

Please sign in to comment.