One way to solve this issue is to use multi-stage build. RUN setx /M PATH $($Env:PATH+' C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/bin/ c:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8.0 Tools/') RUN choco install visualstudio2019buildtools -y -version 16.8.1.0 -params \"-add -add \" # see for a list of available workloads and components RUN choco install dotnetfx -y -version 4.0930 -ignore-package-exit-codes=3010 The following worked for me: FROM /windows/servercore:1809-amd64 This is done by -ignore-package-exit-codes=3010. The only things one has to do is to tell choco not to exit with a non-zero exit code. Note that components might be different in you case. RUN "%TEMP%\vs_community.exe" -quiet -wait -norestart -noUpdateInstaller \ OutFile "%TEMP%\vs_community.exe" -UseBasicParsing The second approach is to install visual studio from the MS website (works perfectly): FROM /windows/servercore:1809 Also, I didn't check that -ignore-package-exit-codes=3010 suppresses only one error or all errors (choco doc says nothing about the possibility to specify the exact code). The problem with that approach is that dotnetfx package seems to be broken - some other packages fail to install due to the missing 'alink.dll' library. RUN choco install -y visualstudio2019buildtools -package-parameters \ # emulate the required restart after installing dotnetfx RUN choco install -y -ignore-package-exit-codes=3010 dotnetfx # suppress the "restart required" error code (3010) "::SecurityProtocol = \"tls12, tls11, tls\" iex ((New-Object ).DownloadString(''))" & SET "PATH=%PATH% %ALLUSERSPROFILE%\chocolatey\bin" $Env:chocolateyUseWindowsCompression = 'false' \ RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \ The first approach is to use multi-stage build as stated above: FROM /windows/servercore:1809 as baseimage OK, looks like you're trying to install VisualStudio 2019. NET already installed: FROM /dotnet/framework/sdk:4.8 I've manage to workaround this problem using a base image with. Tried to install this dotnetfx before run the last command but I get the same error. I tried to run both commands in the same RUN and adding Restart-Computer between them (separte by \) and executing a RUN command after each installation command either but when I do it looks like Docker output get lost.Ĭan I restart the current container during the build process without make Docker get lost and keep the installation process? dotnetfx (exit code 3010) # <- it means a reboot is needed! RUN choco install visualstudio2019-workload-universalbuildtools -package-parameters "-includeOptional" -confirmīut I'm facing this error: Packages requiring reboot: # Universal Windows Platform build tools workload for Visual Studio 2019 Build Tools () RUN Set-ExecutionPolicy Bypass -Scope Process -Force ::SecurityProtocol = ::SecurityProtocol -bor 3072 iex ((New-Object ).DownloadString('')) Dockerfile: FROM /windows/servercore:ltsc2019 I need to restart the Docker container during the build process due dotnetfx.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |