Closed westy closed 1 year ago
This here appears to work though!
#escape=`
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
SHELL ["cmd", "/S", "/C"]
# Install VS components
RUN `
# Install SSDT Build Tools
curl -fSLo vs_BuildTools.exe https://aka.ms/vs/17/release/vs_BuildTools.exe `
&& start /w vs_BuildTools ^ `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ `
--add Microsoft.VisualStudio.Component.SQL.SSDTBuildSku ^ `
--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
# Try and force install using now installed vs_installer
WORKDIR "C:/Program Files (x86)/Microsoft Visual Studio/installer"
RUN vs_installer.exe `
modify --quiet --nocache --add Microsoft.VisualStudio.Component.SQL.SSDTBuildSku --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools"
RUN `
# Cleanup
(for /D %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do rmdir /S /Q "%i") `
&& (for %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do if not "%~nxi" == "vswhere.exe" del "%~i") `
&& powershell Remove-Item -Force -Recurse "%TEMP%\*"
# `
# && rmdir /S /Q "%ProgramData%\Package Cache"
WORKDIR /
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
So, at least I can progress. Be interested to know why the vs_buildtools route does not work though!
This is how I typically add more components: https://github.com/microsoft/dotnet-framework-docker/issues/979#issuecomment-1208413978. I notice you don't use the modify
in the first install command. Can you try that?
Also, there are a lot of log files output to the TEMP directory. When there's an install failure, I recommend looking through all of them.
Thanks for the response. I'll try it with modify. I was using that when trying the various VS installers (but no luck there either), but didn't see it as an option for vs_BuildTools.
I have captured a LOT of logs from %TEMP% and diffed them many times. Nothing much useful that I can see other than the installer one I have posted.
I'll report back with progress.
Cheers
Oh blimey, thank you, that was it!
Very odd that was working fine for ages without it. Thanks, I'll close this now.
Wish I'd asked a week ago now :D
Describe the Bug
I have been using the 4.8 SDK image to successfully build our .NET Framework application and supporting framework for a couple of months now. Given that we use SSDT for our database projects my docker file has to add the Microsoft.VisualStudio.Component.SQL.SSDTBuildSku component to the SDK image. I found a post recommending how to install the build tools here, and extended it accordingly.
I just added the following to my dockerfile, although I have now recreated in a simple extension of the SDK image to can ask for help.
This stopped working around a week ago, and I have been trying various methods to get it working again, such as trying lots of different vs_BuildTools downloads, using the various VS installers to add the component, all with no success.
This morning I have been trying to extend your SDK image to add the component there, rather than add the component in my dockerfile, but am still getting issues (hence me finally raising this issue).
Please help!
Steps to Reproduce
The following dockerfile builds (despite appearing to return a response code of 1), but does not add the desired component:
I am expecting to see an SSDT directory here:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VisualStudio\v17.0
Other Information
ddinstaller{timestamp}.log:
Output of
docker version
Output of
docker info