-
Notifications
You must be signed in to change notification settings - Fork 604
/
Dockerfile.rpi
41 lines (31 loc) · 1.84 KB
/
Dockerfile.rpi
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
ARG IMAGE=balenalib/raspberry-pi
# build
FROM ubuntu:24.04 AS builder
LABEL [email protected]
ARG ARCH=armv6l
ARG CROSSCOMPILER=https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2010.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-10.2.0-pi_0-1.tar.gz
WORKDIR /build/webrtc-streamer
COPY . .
ENV PATH /depot_tools:$PATH
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates build-essential gcc wget git python3 python3-pkg-resources xz-utils cmake make pkg-config \
&& wget -qO- ${CROSSCOMPILER} | tar xz -C /build \
&& export PATH=$(ls -d /build/cross-pi-gcc-*/bin):$PATH \
&& 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 \
&& src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm \
&& gclient sync \
&& cd ../webrtc-streamer \
&& cmake -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \
&& make install \
&& rm -rf ../webrtc && rm -f *.a && rm -f src/*.o \
&& apt-get clean && rm -rf /var/lib/apt/lists/
# run
FROM $IMAGE
LABEL [email protected]
WORKDIR /app/webrtc-streamer
COPY --from=builder /app/ /app/
ENTRYPOINT [ "./webrtc-streamer" ]
CMD [ "-a", "-C", "config.json" ]