Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions eng/dockerfile-templates/sdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,7 @@ RUN `
&& powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" `
&& del vs_TestAgent.exe `
`
# Install VS Build Tools
&& curl -fSLo vs_BuildTools.exe {{VARIABLES["vs|buildToolsUrl"]}} `
&& start /w vs_BuildTools @^ `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" @^ `
--add Microsoft.Component.ClickOnce.MSBuild @^ `
--add Microsoft.Net.Component.{{sdkVersion}}.SDK @^ `
--add Microsoft.NetCore.Component.Runtime.8.0 @^ `
--add Microsoft.NetCore.Component.Runtime.9.0 @^ `
--add Microsoft.NetCore.Component.SDK @^ `
--add Microsoft.VisualStudio.Component.NuGet.BuildTools @^ `
--add Microsoft.VisualStudio.Component.WebDeploy @^ `
--add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup @^ `
--add Microsoft.VisualStudio.Workload.MSBuildTools @^ `
--quiet --norestart --nocache --wait `
&& powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" `
&& del vs_BuildTools.exe `
{{InsertTemplate("Dockerfile.install-vs-buildtools", [], " ")}}
`
# Trigger dotnet first run experience by running arbitrary cmd
&& "%ProgramFiles%\dotnet\dotnet" help `
Expand Down
32 changes: 32 additions & 0 deletions eng/dockerfile-templates/sdk/Dockerfile.install-vs-buildtools
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{

_ ARGS:
usePowerShell: whether to use PowerShell to download and remove files ^

set sdkVersion to when(PRODUCT_VERSION = "4.8.1", "4.8.1", "4.8")

}}# Install VS Build Tools{{
if ARGS.usePowerShell:
&& powershell -Command `
$ProgressPreference = 'SilentlyContinue'; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
Invoke-WebRequest `
-UseBasicParsing `
-Uri {{VARIABLES["vs|buildToolsUrl"]}} `
-OutFile vs_BuildTools.exe `^
else:
&& curl -fSLo vs_BuildTools.exe {{VARIABLES["vs|buildToolsUrl"]}} `}}
&& start /w vs_BuildTools @^ `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" @^ `
--add Microsoft.Component.ClickOnce.MSBuild @^ `
--add Microsoft.Net.Component.{{sdkVersion}}.SDK @^ `
--add Microsoft.NetCore.Component.Runtime.8.0 @^ `
--add Microsoft.NetCore.Component.Runtime.9.0 @^ `
--add Microsoft.NetCore.Component.SDK @^ `
--add Microsoft.VisualStudio.Component.NuGet.BuildTools @^ `
--add Microsoft.VisualStudio.Component.WebDeploy @^ `
--add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup @^ `
--add Microsoft.VisualStudio.Workload.MSBuildTools @^ `
--quiet --norestart --nocache --wait `
&& powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" `
&& del vs_BuildTools.exe `
24 changes: 1 addition & 23 deletions eng/dockerfile-templates/sdk/Dockerfile.ltsc2016
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,7 @@ RUN `
&& powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" `
&& del vs_TestAgent.exe `
`
# Install VS Build Tools
&& powershell -Command `
$ProgressPreference = 'SilentlyContinue'; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
Invoke-WebRequest `
-UseBasicParsing `
-Uri {{VARIABLES["vs|buildToolsUrl"]}} `
-OutFile vs_BuildTools.exe `
&& start /w vs_BuildTools @^ `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" @^ `
--add Microsoft.Component.ClickOnce.MSBuild @^ `
--add Microsoft.Net.Component.4.8.SDK @^ `
--add Microsoft.NetCore.Component.Runtime.6.0 @^ `
--add Microsoft.NetCore.Component.Runtime.8.0 @^ `
--add Microsoft.NetCore.Component.Runtime.9.0 @^ `
--add Microsoft.NetCore.Component.SDK @^ `
--add Microsoft.VisualStudio.Component.NuGet.BuildTools @^ `
--add Microsoft.VisualStudio.Component.WebDeploy @^ `
--add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup @^ `
--add Microsoft.VisualStudio.Workload.MSBuildTools @^ `
--quiet --norestart --nocache --wait `
&& powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" `
&& del vs_BuildTools.exe `
{{InsertTemplate("Dockerfile.install-vs-buildtools", [ "usePowerShell": "true" ], " ")}}
`
# Trigger dotnet first run experience by running arbitrary cmd
&& "%ProgramFiles%\dotnet\dotnet" help `
Expand Down
1 change: 0 additions & 1 deletion src/sdk/3.5/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ RUN `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ `
--add Microsoft.Component.ClickOnce.MSBuild ^ `
--add Microsoft.Net.Component.4.8.SDK ^ `
--add Microsoft.NetCore.Component.Runtime.6.0 ^ `
--add Microsoft.NetCore.Component.Runtime.8.0 ^ `
--add Microsoft.NetCore.Component.Runtime.9.0 ^ `
--add Microsoft.NetCore.Component.SDK ^ `
Expand Down
1 change: 0 additions & 1 deletion src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ RUN `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ `
--add Microsoft.Component.ClickOnce.MSBuild ^ `
--add Microsoft.Net.Component.4.8.SDK ^ `
--add Microsoft.NetCore.Component.Runtime.6.0 ^ `
--add Microsoft.NetCore.Component.Runtime.8.0 ^ `
--add Microsoft.NetCore.Component.Runtime.9.0 ^ `
--add Microsoft.NetCore.Component.SDK ^ `
Expand Down
Loading