diff --git a/.gitlab/pipeline/build-windows.yml b/.gitlab/pipeline/build-windows.yml index 14c22459..8258f981 100644 --- a/.gitlab/pipeline/build-windows.yml +++ b/.gitlab/pipeline/build-windows.yml @@ -15,7 +15,12 @@ build:windows: - Start-Service -Name "docker" - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - - docker build --tag foo -f Dockerfile.windows . + - docker pull $CI_REGISTRY_IMAGE:latest || true + - docker build + --pull + --tag foo + -f Dockerfile.windows + . - docker push foo after_script: - docker logout $CI_REGISTRY diff --git a/Dockerfile.windows b/Dockerfile.windows index 553f41f2..f33a72b3 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,19 +1,18 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 -SHELL ["powershell", "-Command"] - -RUN $env:starter_path = Get-Location +SHELL ["powershell.exe", "-Command"] # 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" \ - -ArgumentList "--quiet", "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \ - "--add", "Microsoft.VisualStudio.Workload.VCTools", "--includeRecommended" -Wait +RUN $env:starter_path = Get-Location; \ + Invoke-WebRequest "https://aka.ms/vs/17/release/vs_buildtools.exe" \ + -OutFile "$env:TEMP\vs_buildtools.exe" -UseBasicParsing; \ + Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" \ + -ArgumentList "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \ + "--add", "Microsoft.VisualStudio.Workload.VCTools" -Wait # install vcpkg -RUN $env:VCPKG_INSTALL_DIR = "c:\\vcpkg" -RUN $env:VCPKG_DEFAULT_TRIPLET="x64-windows" +RUN $env:VCPKG_INSTALL_DIR = "c:\\vcpkg"; \ + $env:VCPKG_DEFAULT_TRIPLET="x64-windows" RUN git clone https://github.com/microsoft/vcpkg $env:VCPKG_INSTALL_DIR && \ cd $env:VCPKG_INSTALL_DIR && \ bootstrap-vcpkg.bat -disableMetrics && \ @@ -22,3 +21,9 @@ RUN git clone https://github.com/microsoft/vcpkg $env:VCPKG_INSTALL_DIR && \ # 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" + +# 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"]