-
Notifications
You must be signed in to change notification settings - Fork 604
/
Dockerfile
48 lines (38 loc) · 1.87 KB
/
Dockerfile
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
# build
FROM ubuntu:24.04 AS builder
LABEL [email protected]
ARG USERNAME=dev
ARG USERID=10000
WORKDIR /build/webrtc-streamer
COPY . .
ENV PATH /depot_tools:/build/webrtc/src/third_party/llvm-build/Release+Asserts/bin:$PATH
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates wget git python3 python3-pkg-resources g++ autoconf automake libtool xz-utils libpulse-dev libasound2-dev libgtk-3-dev libxtst-dev libssl-dev librtmp-dev cmake make pkg-config p7zip-full sudo \
&& groupadd --gid $USERID $USERNAME && useradd --uid $USERID --gid $USERNAME -m -s /bin/bash $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot_tools \
&& mkdir ../webrtc \
&& cd ../webrtc \
&& fetch --no-history --nohooks webrtc \
&& sed -i -e "s|'src/resources'],|'src/resources'],'condition':'rtc_include_tests==true',|" src/DEPS \
&& gclient sync \
&& cd ../webrtc-streamer \
&& cmake -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ . && make \
&& make install \
&& git clean -xfd \
&& find ../webrtc/src -type d -name .git -exec rm -rf {} \; || true \
&& rm -rf ../webrtc/src/out \
&& apt-get clean && rm -rf /var/lib/apt/lists/
USER $USERNAME
# run
FROM ubuntu:24.04
LABEL [email protected]
WORKDIR /app/webrtc-streamer
COPY --from=builder /app/ /app/
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libssl-dev libasound2-dev libgtk-3-0 libxtst6 libsm6 libpulse0 librtmp1 avahi-utils \
&& useradd -m user -G video,audio \
&& apt-get clean && rm -rf /var/lib/apt/lists/ \
&& ./webrtc-streamer -V
USER user
ENTRYPOINT [ "./webrtc-streamer" ]
CMD [ "-C", "config.json" ]