mesa/.gitlab-ci/windows/Dockerfile_msvc
Yonggang Luo 9592686ca0 ci/windows: Use winget to install packages and install Microsoft.WindowsWDK.10.0.26100
And switch all packages use winget to install.

bloodrock.pkg-config-lite according https://github.com/microsoft/winget-pkgs/pull/284186
WinFlexBison.win_flex_bison according https://github.com/microsoft/winget-pkgs/pull/284202
Git.Git already contains 'GitHub.GitLFS' according https://github.com/microsoft/winget-pkgs/issues/276985

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37210>
2025-09-17 06:53:33 +00:00

34 lines
1.6 KiB
Text

# escape=`
ARG base_image
FROM ${base_image}
# https://www.thomasmaurer.ch/2019/07/how-to-install-and-update-powershell-7/
# Wrapping the following command in cmd.exe
# iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
RUN powershell -ExecutionPolicy RemoteSigned -Command "$ErrorActionPreference = 'Stop'; iex ""& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"""
# Make sure any failure in PowerShell scripts is fatal
SHELL ["pwsh", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN Write-Output $PSVersionTable $ErrorActionPreference
COPY mesa_deps_msvc.ps1 C:\
RUN C:\mesa_deps_msvc.ps1
COPY mesa_deps_winget.ps1 C:\
RUN C:\mesa_deps_winget.ps1
COPY mesa_deps_winget_settings.json C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WinGet\Settings\defaultState\settings.json
COPY mesa_deps_packages.ps1 C:\
RUN C:\mesa_deps_packages.ps1
# Example usage:
# `base_image` should use windows image that can be run with `--isolation=process` option,
# since the resulting container will want to be used that way be later containers in the build process.
# Only --isolation=hyperv can succeed building this container locally,
# --isolation=process have network issue when installing Visual Studio and choco will crash
# docker build --isolation=hyperv -f .\Dockerfile_msvc -t mesa_msvc --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .
# Example run:
# docker run --isolation=hyperv -it --rm -v ${PWD}:${PWD} mesa_msvc pwsh -ExecutionPolicy RemoteSigned
# docker run --isolation=process -it --rm -v ${PWD}:${PWD} mesa_msvc pwsh -ExecutionPolicy RemoteSigned