forked from mpromonet/webrtc-streamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.windows
53 lines (44 loc) · 2.42 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
# build
FROM cirrusci/windowsservercore:2019 as builder
LABEL maintainer=michel.promonet@free.fr
WORKDIR /webrtc-streamer
COPY . /webrtc-streamer
ENV DEPOT_TOOLS_WIN_TOOLCHAIN=0 \
CLANG_VERSION=ToT \
PYTHONIOENCODING=UTF-8 \
MSVC_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" \
chocolateyUseWindowsCompression="true"
# 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 \
&& choco install --no-progress -y git python2 sed curl windows-sdk-10 windows-sdk-10-version-2004-all \
&& choco install --no-progress -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' \
&& choco install --no-progress -y visualstudio2017buildtools --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
# install depot_tools
RUN git config --global core.autocrlf false \
&& git config --global core.filemode false \
&& git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git --depth 1 C:\depot_tools \
&& SETX PATH "%PATH%;C:\depot_tools\;C:\webrtc\src\third_party\llvm-build\Release+Asserts\bin;C:\webrtc\src\build\toolchain\win\rc\win"
RUN call "%MSVC_PATH%\VC\Auxiliary\Build\vcvars64.bat" \
&& mkdir c:\webrtc && cd c:\webrtc \
&& time /t \
&& fetch --no-history --nohooks webrtc \
&& time /t \
&& sed -i -e "s|'src/resources'],|'src/resources'],'condition':'rtc_include_tests==true',|" src/DEPS \
&& gclient sync \
&& time /t \
&& cd C:\webrtc-streamer \
&& cmake -G Ninja -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe . \
&& time /t \
&& ninja \
&& time /t \
&& mkdir c:\app && copy webrtc-streamer.exe c:\app && copy config.json c:\app && xcopy /E html c:\app\html\ \
&& rmdir /s /q c:\webrtc
# run
FROM mcr.microsoft.com/windows:1809
WORKDIR /app
COPY --from=builder /app/ /app/
RUN webrtc-streamer.exe -V
EXPOSE 8000
ENTRYPOINT [ "webrtc-streamer.exe" ]
CMD [ "-a", "-C", "config.json" ]