FROM mcr.microsoft.com/windows/servercore:ltsc2019 SHELL ["cmd", "/S", "/C"] #Java Dependency for SonarCloud RUN curl -SL --output jdk-installer.msi https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.3_7.msi RUN msiexec /i jdk-installer.msi /quiet /qn /norestart RUN del jdk-installer.msi #NodeJS Dependency for SonarCloud RUN curl -SL --output node.msi https://nodejs.org/dist/v18.13.0/node-v18.13.0-x64.msi RUN msiexec /i node.msi /quiet /qn /norestart RUN del node.msi #NuGet Dependency RUN mkdir "C:/Program Files (x86)/Nuget" RUN curl -SL --output "C:/Program Files (x86)/Nuget/nuget.exe" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe #Credential Helper fpr Azure NuGet RUN curl -SL --output installcredprovider.ps1 https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1 RUN powershell -command "./installcredprovider.ps1 -AddNetfx" RUN del installcredprovider.ps1 #Sonar Runner for code quality #RUN curl -SL --output sonar-scanner.zip https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/5.9.2.58699/sonar-scanner-msbuild-5.9.2.58699-net46.zip #RUN powershell -command "Expand-Archive -Force 'C:/sonar-scanner.zip' C:/sonar-scanner" #RUN powershell -command "Set-Content -Path 'C:/sonar-scanner/SonarQube.Analysis.xml' -Value 'https://sonarcloud.io'" #RUN powershell -command "$ACL = Get-Acl -Path 'C:/sonar-scanner/hostfxr.dll'; Set-Acl -Path 'C:/sonar-scanner/SonarQube.Analysis.xml' -AclObject $ACL" #RUN del sonar-scanner.zip #Build tools RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe RUN start /w vs_buildtools.exe --quiet --wait \ --add Microsoft.VisualStudio.Workload.WebBuildTools \ --add Microsoft.VisualStudio.Workload.ManagedDesktop \ --add Microsoft.VisualStudio.Workload.NetWeb \ --add Microsoft.VisualStudio.Workload.CoreEditor \ --add Microsoft.Net.Component.4.7.2.TargetingPack \ --add Microsoft.Net.Component.4.6.1.TargetingPack \ --add Microsoft.Net.Component.4.5.2.SDK \ --add Microsoft.Net.Component.4.5.TargetingPack \ --add Microsoft.Net.Component.4.8.SDK \ --add Microsoft.NetCore.Component.SDK \ --norestart --nocache --installPath "%ProgramFiles(x86)%/Microsoft Visual Studio/BuildTools" RUN del vs_buildtools.exe RUN setx path "%path%;C:\Program Files (x86)\Nuget" RUN setx path "%path%;C:\sonar-scanner" RUN setx path "%path%;C:\Program Files (x86)\Microsoft Visual Studio\BuildTools\MSBuild\Current\Bin"