marchaesen / vcxsrv

Windows X-server based on the xorg git sources (like xming or cygwin's xwin), but compiled with Visual Studio 2012 Community Edition.
GNU General Public License v3.0
358 stars 14 forks source link

Docker image fails to build, required .net 4.8 #19

Open richschulman2008 opened 2 months ago

richschulman2008 commented 2 months ago

running the dockerBuild.cmd fails to build docker image at step 5. Output below:

Step 5/12 : RUN choco install -y strawberryperl         && ren Strawberry Perl  && rd /s /q C:\Users\ContainerAdministrator\AppData\Local\Temp      && mkdir C:\Users\ContainerAdministrator\AppData\Local\Temp     && setx /m path "%path%;c:\perl\perl\bin"
 ---> Running in cd80ade0f04f
Chocolatey v2.3.0
.NET 4.8 is not installed or may need a reboot to complete installation.
Please install .NET Framework 4.8 manually and reboot the system.
Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'
The command 'cmd /S /C choco install -y strawberryperl  && ren Strawberry Perl  && rd /s /q C:\Users\ContainerAdministrator\AppData\Local\Temp      && mkdir C:\Users\ContainerAdministrator\AppData\Local\Temp     && setx /m path "%path%;c:\perl\perl\bin"' returned a non-zero code: 1

I found this solution on stack exchange https://stackoverflow.com/questions/76470752/chocolatey-installation-in-docker-started-to-fail-restart-due-to-net-framework. Replaced base docker image

# FROM mcr.microsoft.com/windows/servercore:ltsc2019
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016

Image build successfully after that. There is probably a more efficient way to solve this issue but I'm not a Windows dev (I just play one on TV)