-
Notifications
You must be signed in to change notification settings - Fork 611
/
Dockerfile.windows
58 lines (46 loc) · 2.54 KB
/
Dockerfile.windows
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
# build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 AS builder
LABEL [email protected]
WORKDIR /webrtc-streamer
COPY . /webrtc-streamer
SHELL ["cmd", "/S", "/C"]
ENV DEPOT_TOOLS_WIN_TOOLCHAIN=0 \
CLANG_VERSION=ToT \
PYTHONIOENCODING=UTF-8 \
MSVC_PATH="C:\Program Files\Microsoft Visual Studio\2022\Community"
# Install Windows 10 SDK
RUN powershell -c "Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?linkid=2272610' -OutFile winsdksetup.exe -UseBasicParsing ;"
RUN winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q /norestart
# 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"
RUN choco install --no-progress -y 7zip git curl sed
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.Workload.VCTools --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended --nocache --installPath %MSVC_PATH%" || IF "%ERRORLEVEL%"=="3010" EXIT 0
RUN git config --global core.autocrlf false \
&& git config --global core.filemode false \
&& git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git C:\depot_tools \
&& SETX PATH "C:\depot_tools\;C:\webrtc\src\third_party\llvm-build\Release+Asserts\bin;C:\webrtc\src\build\toolchain\win\rc\win;%PATH%" \
&& refreshenv \
&& call "%MSVC_PATH%\VC\Auxiliary\Build\vcvars64.bat" \
&& set \
&& time /t \
&& mkdir c:\webrtc && cd c:\webrtc \
&& fetch webrtc \
&& time /t \
&& cd C:\webrtc-streamer \
&& cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DCMAKE_MAKE_PROGRAM=ninja.bat . \
&& time /t \
&& ninja \
&& ninja install \
&& del /f /s /q c:\webrtc > nul && rmdir /s /q c:\webrtc \
&& time /t
RUN powershell -c "sleep -Seconds 60" && time /t
# run
FROM mcr.microsoft.com/windows/server:ltsc2022
LABEL [email protected]
WORKDIR /app/webrtc-streamer
COPY --from=builder /app/ /app/
RUN dir /w && set
RUN webrtc-streamer.exe -V
ENTRYPOINT [ "webrtc-streamer.exe" ]
CMD [ "-a", "-C", "config.json" ]