You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: build/README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -692,3 +692,47 @@ After everything builds successfully, the packaging process kicks off and perfor
692
692
📄 devcontainer.json
693
693
📄 Dockerfile
694
694
```
695
+
696
+
## Linux ARM64 Specific Builds
697
+
698
+
The below provides a mechanism to build and test against targeted platforms (e.g. Linux ARM64). The following example uses the the dotnet container image for reference.
699
+
700
+
### Build
701
+
702
+
Run the docker build command using `buildx` from the .devcontainer in the dotnet directory within the project repo (`containers/dotnet/.devcontainer`). [buildx](https://docs.docker.com/buildx/working-with-buildx/) is a Docker CLI plugin that provides the ability to target multi-architectures (e.g. ARM64).
703
+
704
+
Note a few of the arguments:
705
+
706
+
- `--platform`: specifies the architecture to target, in this case we will be targeting Linux ARM64
707
+
- `--build-arg`: for this example, we will be targeting specific dotnet versions (e.g. 6.0, 5.0, and 3.1) and Linux versions and distros.
Once the build is complete, run the image using the below example. Note that the dotnet directory is mounted. The dotnet directory includes test scripts which will be used in the subsequent steps.
714
+
715
+
```bash
716
+
docker run -v $REPODIR/vscode-dev-containers/containers/dotnet/:/workspace --platform linux/arm64 -it dotnet-arm64 bash
717
+
```
718
+
719
+
Once in the running container, verify that the architecture is ARM64 by running the command:
720
+
721
+
```bash
722
+
uname -m
723
+
```
724
+
725
+
For ARM64 on Linux, the architecture will show as `aarch64`.
726
+
727
+
### Test
728
+
729
+
For Linux ARM64 and the Dotnet container requires that [VS Code attaches](https://code.visualstudio.com/docs/remote/attach-container) to the running container instance. Using VS Code and the [Remote-Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), attach to the running instance of the image previously created, run the test script and they should all pass.
730
+
731
+
```bash
732
+
/workspace/test-project/test.sh
733
+
```
734
+
735
+
### Reference
736
+
737
+
- [ARM documentation](https://developer.arm.com/documentation/102475/0100/Multi-architecture-images) for how to build multi-architecture images.
738
+
- [List of Supported Linux ARM64 DotNet SDK Images](https://hub.docker.com/_/microsoft-dotnet-sdk)
0 commit comments