summaryrefslogtreecommitdiff
path: root/ci/docker/windows/Dockerfile
blob: 02253f36c983f0e632ad2cd25e79ad64ad08c63c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# escape=`

FROM 'mcr.microsoft.com/windows/server:ltsc2022'

# Make sure any failure in PowerShell is fatal
ENV ErrorActionPreference='Stop'
SHELL ["powershell","-NoLogo", "-NonInteractive", "-Command"]

RUN Install-WindowsFeature -Name Server-Media-Foundation

# Install Chocolatey
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install required packages
RUN choco install -y vcredist140
RUN choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
RUN choco install -y git --params '/NoAutoCrlf /NoCredentialManager /NoShellHereIntegration /NoGuiHereIntegration /NoShellIntegration'
RUN choco install -y git-lfs
RUN choco install -y 7zip
RUN choco install -y python3 --installargs 'AssociateFiles=1 PrependPath=1 Include_pip=1 Include_dev=1'
RUN choco install -y msys2 --params '/NoPath /NoUpdate /InstallDir:C:\\msys64'
RUN choco install -y wixtoolset

# Remove MAX_PATH limit of 260 characters
RUN New-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem' `
    -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
RUN git config --system core.longpaths true

RUN c:\msys64\usr\bin\bash -lc 'pacman -S --noconfirm mingw-w64-ucrt-x86_64-toolchain ninja'
# Visual Studio can't be installed with choco.
# It depends on dotnetfx v4.8.0.20190930, which requires a reboot: dotnetfx (exit code 3010)
# https://github.com/microsoft/vs-dockerfiles/blob/main/native-desktop/
# Set up environment to collect install errors.
COPY Install.cmd C:\TEMP\
RUN Invoke-WebRequest -Uri https://aka.ms/vscollect.exe -OutFile C:\TEMP\collect.exe
# Download channel for fixed install.
RUN Invoke-WebRequest -Uri https://aka.ms/vs/16/release/channel -OutFile C:\TEMP\VisualStudio.chman
# Download and install Build Tools for Visual Studio 2017 for native desktop workload.
RUN Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile C:\TEMP\vs_buildtools.exe
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
    --channelUri C:\TEMP\VisualStudio.chman `
    --installChannelUri C:\TEMP\VisualStudio.chman `
    --add Microsoft.VisualStudio.Workload.VCTools `
    --add Microsoft.VisualStudio.Workload.UniversalBuildTools `
    --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 `
    --add Microsoft.VisualStudio.Component.VC.Tools.ARM `
    --add Microsoft.VisualStudio.Component.UWP.VC.ARM64 `
    --includeRecommended `
    --installPath C:\BuildTools

RUN Get-ChildItem C:\BuildTools
RUN Get-ChildItem C:\BuildTools\VC\Tools\MSVC
RUN Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\lib'

RUN pip3 install meson==0.62.2

RUN 'git config --global user.email "cirunner@gstreamer.freedesktop.org"; git config --global user.name "GStreamer CI system"'

COPY install_mingw.ps1 C:\
RUN C:\install_mingw.ps1

ARG DEFAULT_BRANCH="main"

COPY prepare_gst_env.ps1 C:\
RUN C:\prepare_gst_env.ps1

COPY prepare_cerbero_env.sh  C:\
RUN C:\MinGW\msys\1.0\bin\bash.exe --login -c "C:/prepare_cerbero_env.sh"