diff --git a/Dockerfile.windows b/Dockerfile.windows index eec679f6..279198a4 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,32 +1,38 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 # Reset the shell. -SHELL ["cmd", "/S", "/C"] +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +# Download and install Build Tools for Visual Studio 2022 for native desktop +RUN wget https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile "$Env:TEMP\vs_buildtools.exe"; \ + wget https://aka.ms/vs/17/release/VisualStudio.chman -OutFile "$Env:TEMP\VisualStudio.chman"; \ + Start-Process -FilePath $env:TEMP\vs_buildtools.exe -ArgumentList \ + "--quiet", \ + "--norestart", \ + "--nocache", \ + # "--installPath", \ + # "c:\ProgramFiles (x86)\Microsoft Visual Studio\2022\BuildTools", \ + "--wait", \ + "--channelUri", \ + "$Env:TEMP\VisualStudio.chman", \ + "--installChannelUri", \ + "$Env:TEMP\VisualStudio.chman", \ + "--add", \ + "Microsoft.VisualStudio.Workload.VCTools", \ + "Microsoft.Net.Component.4.8.SDK", \ + "Microsoft.VisualStudio.Component.VC.ATLMFC", \ + "--includeRecommended" \ + -Wait -PassThru; \ + del $Env:TEMP\vs_buildtools.exe; -# Install Chocolatey & packages -RUN powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command \ - "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && \ - SETX PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" +# install git and cmake from choco +RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \ + choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y --no-progress; \ + choco install git -y --no-progress -RUN choco install --no-progress -y git -RUN choco install --no-progress -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' -RUN choco install --ignoredetectedreboot --no-progress -y visualstudio2022buildtools - # --package-parameters \ - # "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - # --add Microsoft.Component.MSBuild \ - # --add Microsoft.VisualStudio.Component.Windows11SDK.22621 \ - # --includeRecommended --nocache --installPath %MSVC_PATH%" \ - # || IF "%ERRORLEVEL%"=="3010" EXIT 0 -# RUN choco install --ignoredetectedreboot --no-progress -y visualstudio2022-workload-vctools - -# Clone and bootstrap vcpkg. -RUN git clone https://github.com/Microsoft/vcpkg.git c:\vcpkg && \ +RUN git clone https://github.com/microsoft/vcpkg.git c:\vcpkg; \ c:\vcpkg\bootstrap-vcpkg.bat -disableMetrics -# Install capnproto via vcpkg. -RUN c:\vcpkg\vcpkg install capnproto:x64-windows +RUN c:\vcpkg\vcpkg install eigen3 --clean-after-build -# Use developer command prompt and start PowerShell if no other command specified. -# ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=x64 -host_arch=x64 && -CMD powershell.exe -NoLogo -ExecutionPolicy Bypass +ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]