-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathDockerfile
More file actions
159 lines (148 loc) · 5.15 KB
/
Dockerfile
File metadata and controls
159 lines (148 loc) · 5.15 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
FROM ubuntu:noble
LABEL org.opencontainers.image.title="webrtcperf"
LABEL org.opencontainers.image.description="WebRTC performance and quality evaluation tool."
LABEL org.opencontainers.image.source="https://github.com/vpalmisano/webrtcperf"
LABEL org.opencontainers.image.authors="Vittorio Palmisano <vpalmisano@gmail.com>"
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
python3 \
bash \
curl \
xvfb \
unzip \
procps \
xauth \
sudo \
net-tools \
iproute2 \
iptables \
mesa-va-drivers \
gnupg \
apt-utils \
apt-transport-https \
ca-certificates \
fonts-liberation \
fonts-lato \
fonts-noto-mono \
libasound2t64 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libc6 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libexpat1 \
libfontconfig1 \
libgbm1 \
libgcc1 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libstdc++6 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
libvulkan1 \
lsb-release \
openssl \
wget \
xdg-utils \
libgles1 \
libgles2 \
libegl1 \
libegl-mesa0 \
fonts-noto-color-emoji \
libu2f-udev \
libfontconfig1 \
libfribidi0 \
libharfbuzz0b \
libspeex1 \
libtesseract5 \
tesseract-ocr-eng \
libvorbis0a \
libvorbisenc2 \
libvorbisfile3 \
libogg0 \
libvpx9 \
libwebpdemux2 \
libx264-164 \
libzimg2 \
libx265-199 \
libzmq5 \
xz-utils \
wireshark
RUN \
mkdir -p /etc/apt/keyrings; \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list; \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -; \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
nodejs \
yarn \
libnvidia-gl-570 \
nvidia-utils-570
# RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -; \
# echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list; \
# apt-get update && apt-get install -y google-chrome-stable && apt-get clean
# chromium-browser-unstable
ENV CHROMIUM_VERSION=146.0.7643.1
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCH=arm64; else ARCH=amd64; fi; \
curl -s -Lo /chromium-browser-unstable.deb "https://github.com/vpalmisano/webrtcperf/releases/download/chromium-${CHROMIUM_VERSION}/chromium-browser-unstable_${CHROMIUM_VERSION}-1_${ARCH}.deb" \
&& dpkg -i /chromium-browser-unstable.deb \
&& rm chromium-browser-unstable.deb
RUN apt-get clean \
&& rm -rf /var/cache/apt/* \
&& rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/vpalmisano/webrtcperf-ffmpeg:devel /usr/bin/ffmpeg /usr/bin/ffprobe /usr/bin/
COPY --from=ghcr.io/vpalmisano/webrtcperf-ffmpeg:devel /usr/lib/x86_64-linux-gnu*/libvmaf.so* /usr/lib/x86_64-linux-gnu/
COPY --from=ghcr.io/vpalmisano/webrtcperf-ffmpeg:devel /usr/lib/aarch64-linux-gnu*/libvmaf.so* /usr/lib/aarch64-linux-gnu/
COPY --from=ghcr.io/vpalmisano/webrtcperf-ffmpeg:devel /usr/share/model/* /usr/share/model/
# Optional dependencies.
COPY --from=ghcr.io/vpalmisano/webrtcperf-visqol:devel /src/visqol/bazel-bin/visqol /usr/bin/
COPY --from=ghcr.io/vpalmisano/webrtcperf-visqol:devel /src/visqol/model /usr/share/visqol/model
# Default test video.
RUN mkdir -p /app/
RUN curl -s -Lo /app/video.mp4 "https://github.com/vpalmisano/webrtcperf/releases/download/videos-1.0/kt.mp4" \
&& ffprobe /app/video.mp4
#
WORKDIR /app
ENV DEBUG_LEVEL=WARN
ENV DEBUGGING_ADDRESS=0.0.0.0
ENV VIDEO_PATH=/app/video.mp4
ENV CHROMIUM_PATH=/usr/bin/chromium-browser-unstable
ENV NODE_ENV=production
ENTRYPOINT ["/app/entrypoint.sh"]
RUN \
mkdir -p /etc/chromium/policies/managed/ && \
cat <<'EOF' > /etc/chromium/policies/managed/managed_policies.json
{
"CommandLineFlagSecurityWarningsEnabled": false
}
EOF
COPY package.json yarn.lock /app/
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN \
--mount=type=cache,id=webrtcperf-cache-yarn,target=/root/.cache/yarn,sharing=shared \
yarn install --frozen-lockfile --production --network-timeout 60000 --network-concurrency 1 --cache-folder /root/.cache/yarn
COPY app.min.js entrypoint.sh /app/