Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Update build system to use buildx, support multi-arch builds #1018

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

Chuxel
Copy link
Member

@Chuxel Chuxel commented Aug 30, 2021

Implements #914.

This PR does not update config to start building linux/arm64, but rather sets up the build system to do so. See #558 (comment) for issues preventing switch, current plan of action.

} else {
await asyncUtils.spawn('docker', ['buildx', 'use', 'vscode-dev-containers']);
}
await asyncUtils.spawn('docker', ['run', '--privileged', '--rm', 'tonistiigi/binfmt', '--install', 'all']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea what this line is doing :D . Maybe add a comment to make it more clear?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - it sets up QEMU to enable multi-platform builds. Docker Desktop does htis as a part of install so people don't know. Will add a comment.

case 'aarch32': localArchitecture = 'linux/arm/v7'; break;
case 'aarch64': localArchitecture = 'linux/arm64'; break;
case 'x64': localArchitecture = 'linux/amd64'; break;
case 'x32': localArchitecture = 'linux/386'; break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be linux/i386? Doesn't look right to me without the i for some reason, but I might just be wrong

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah for Docker it's w/o the i. Type docker buildx ls locally to see architectures that are setup to emulate. Desktop has them all installed.

@Chuxel Chuxel merged commit fdc4973 into main Aug 31, 2021
@Chuxel
Copy link
Member Author

Chuxel commented Aug 31, 2021

@joshspicer Triggered dev builds and they all successfully ran. The codespaces-linux image will now be built using buildx which should help reduce total layers.

@Chuxel Chuxel deleted the clantz/buildx branch August 31, 2021 23:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants