-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathDockerfile
150 lines (139 loc) · 5.18 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
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
FROM --platform=$TARGETPLATFORM ubuntu:jammy
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 <[email protected]>
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 \
libasound2 \
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 \
libegl1-mesa \
fonts-noto-color-emoji \
libu2f-udev \
libfontconfig1 \
libfribidi0 \
libharfbuzz0b \
libspeex1 \
libtesseract4 \
tesseract-ocr-eng \
libvorbis0a \
libvorbisenc2 \
libvorbisfile3 \
libogg0 \
libvpx7 \
libwebpdemux2 \
libx264-163 \
libzimg2 \
libx265-199 \
openssl \
libzmq5
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; \
wget -q -O- https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub | gpg --dearmor -o /usr/share/keyrings/nvidia-drivers.gpg; \
echo 'deb [signed-by=/usr/share/keyrings/nvidia-drivers.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /' | sudo tee /etc/apt/sources.list.d/nvidia-drivers.list; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
nodejs \
yarn \
libnvidia-gl-515 \
nvidia-utils-515
# 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=132.0.6779.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/visqo[l] /usr/bin/
#COPY --from=ghcr.io/vpalmisano/webrtcperf-visqol:devel /src/visqol/mode[l] /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/v2.0.4/video.mp4" \
&& ffprobe /app/video.mp4
#
WORKDIR /app
ENV DEBUG_LEVEL=WARN
ENV VIDEO_PATH=/app/video.mp4
ENV CHROMIUM_PATH=/usr/bin/chromium-browser-unstable
ENTRYPOINT ["/app/entrypoint.sh"]
COPY package.json yarn.lock /app/
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN yarn install --frozen-lockfile --production || yarn install --frozen-lockfile --production
COPY scripts /app/scripts/
COPY app.min.js entrypoint.sh /app/