| ... | @@ -15,7 +15,35 @@ Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/ |
... | @@ -15,7 +15,35 @@ Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/ |
|
|
|
|
|
|
|
The system will reboot!
|
|
The system will reboot!
|
|
|
|
|
|
|
|
Follow instructions from [Install Build Tools into a container](https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022) to generate the `buildtools` docker image.
|
|
Follow instructions from [Install Build Tools into a container](https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022) to generate the `buildtools` docker image. Use the following Dockerfile:
|
|
|
|
|
|
|
|
```
|
|
|
|
# escape=`
|
|
|
|
|
|
|
|
# Use the latest Windows Server Core 2022 image.
|
|
|
|
FROM mcr.microsoft.com/windows/servercore:ltsc2022
|
|
|
|
|
|
|
|
# Restore the default Windows shell for correct batch processing.
|
|
|
|
SHELL ["cmd", "/S", "/C"]
|
|
|
|
|
|
|
|
RUN `
|
|
|
|
# Download the Build Tools bootstrapper.
|
|
|
|
curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe `
|
|
|
|
`
|
|
|
|
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
|
|
|
|
&& (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
|
|
|
|
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" `
|
|
|
|
--add Microsoft.VisualStudio.Workload.MSBuildTools `
|
|
|
|
--add MMicrosoft.VisualStudio.Workload.VCTools `
|
|
|
|
|| IF "%ERRORLEVEL%"=="3010" EXIT 0) `
|
|
|
|
`
|
|
|
|
# Cleanup
|
|
|
|
&& del /q vs_buildtools.exe
|
|
|
|
|
|
|
|
# Define the entry point for the docker container.
|
|
|
|
# This entry point starts the developer command prompt and launches the PowerShell shell.
|
|
|
|
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
|
|
|
|
```
|
|
|
|
|
|
|
|
Install Gitlab runner:
|
|
Install Gitlab runner:
|
|
|
|
|
|
| ... | | ... | |