diff --git a/Dockerfile.windows b/Dockerfile.windows index 6f72a209..9ed784a1 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,42 +1,56 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference='SilentlyContinue'; $VerbosePreference = 'Continue';"] - -# RUN $env:starter_path = Get-Location +# Reset the shell. +SHELL ["cmd", "/S", "/C"] # download and install vs build tools needed by vcpkg -RUN Invoke-WebRequest "https://aka.ms/vs/17/release/vs_buildtools.exe" \ - -OutFile "$env:TEMP\vs_buildtools.exe" -UseBasicParsing -RUN Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" \ +RUN powershell -Command \ + Invoke-WebRequest -Uri https://aka.ms/vs/17/release/channel -OutFile $env:TEMP\VisualStudio.chman; \ + Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile $env:TEMP\vs_buildtools.exe; \ + Start-Process -Wait -FilePath "$env:TEMP\vs_buildtools.exe" \ -ArgumentList "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \ + "--channelUri", "$env:TEMP\VisualStudio.chman" \ + "--installChannelUri", "$env:TEMP\VisualStudio.chman" \ "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", \ "--add", "Microsoft.Component.MSBuild", \ "--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621", \ - "--includeRecommended" \ - -Wait; \ - Start-Process -FilePath "C:\\Program Files\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat" -NoNewWindow - -# install git from choco -RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \ - choco install git -y --no-progress + "--includeRecommended"; + +# install git +RUN powershell -Command \ + Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/Git-2.44.0-64-bit.exe -OutFile $env:TEMP\git-installer.exe ; \ + Start-Process -Wait -FilePath "$env:TEMP\git-installer.exe" -ArgumentList '/VERYSILENT', '/NORESTART' ; \ + Remove-Item $env:TEMP\git-installer.exe -Force +ENV PATH="${PATH};C:\Program Files\Git\cmd" + +# install cmake +RUN powershell -Command \ + Invoke-WebRequest -Uri https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-windows-x86_64.msi -OutFile $env:TEMP\cmake-installer.msi ; \ + Start-Process -Wait -FilePath msiexec.exe -ArgumentList '/i', '$env:TEMP\cmake-installer.msi', '/quiet', '/norestart' ; \ + Remove-Item $env:TEMP\cmake-installer.msi -Force +ENV PATH="${PATH};C:\Program Files\CMake\bin" + +# add MSVC path +ENV PATH="${PATH};C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" +ENV PATH="${PATH};C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64" # install vcpkg -# RUN $env:VCPKG_INSTALL_DIR="c:\\vcpkg" -# RUN $env:VCPKG_DEFAULT_TRIPLET="x64-windows" -RUN git clone https://github.com/microsoft/vcpkg c:\vcpkg; \ - Start-Process -FilePath "c:\vcpkg\bootstrap-vcpkg.bat -ArgumentList "-disableMetrics" -Wait; \ - c:\vcpkg\vcpkg install cgal boost-program-options boost-timer boost-test --triplet x64-windows +RUN git clone https://github.com/microsoft/vcpkg c:\vcpkg && \ + c:\vcpkg\bootstrap-vcpkg.bat -disableMetrics +ENV VCPKG_DEFAULT_TRIPLET=x64-windows +ENV PATH="${PATH};C:\vcpkg" + +# install sfcgal dependencies +RUN vcpkg integrate install && \ + vcpkg install cgal boost-program-options boost-timer boost-test # build sfcgal -# RUN cd $env:starter_path; \ -# cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSFCGAL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake" -RUN cmake -S . -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DSFCGAL_BUILD_TESTS=OFF \ - -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake" - -# Restore default shell for Windows containers. -SHELL ["cmd.exe", "/s", "/c"] - -# Default to PowerShell if no other command specified. -CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] +# # RUN cd $env:starter_path; \ +# # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSFCGAL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake" +# RUN cmake -S . -B build \ +# -DCMAKE_BUILD_TYPE=Release \ +# -DSFCGAL_BUILD_TESTS=OFF \ +# -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake" + +# # Default to PowerShell if no other command specified. +# CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]