-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (42 loc) · 2.14 KB
/
Dockerfile
File metadata and controls
49 lines (42 loc) · 2.14 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
FROM trion/ng-cli:latest
ARG CHROME_VERSION=<unset> USER_ID=1000
LABEL chrome=$CHROME_VERSION ng-cli='21.2.3'
USER root
COPY xvfb-chromium /usr/bin/xvfb-chromium
COPY xvfb-chromium-webgl /usr/bin/xvfb-chromium-webgl
COPY display-chromium /usr/bin/display-chromium
RUN apt-get update \
&& apt-get install -y \
xvfb \
libxss1 \
libosmesa6 \
libgconf-2-4 \
wget \
apt-transport-https \
&& MACH=$(uname -m) \
&& [ $MACH = "x86_64" ] && ( \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& (dpkg -i google-chrome-stable_current_amd64.deb; apt --fix-broken install -y; apt-get -fy install; rm google-chrome-stable_current_amd64.deb; apt-get clean; rm -rf /var/lib/apt/lists/* ) \
&& mv /usr/bin/google-chrome-stable /usr/bin/google-chrome.real \
&& mv /opt/google/chrome/chrome /opt/google/chrome/google-chrome.real \
&& ln -s /usr/lib/x86_64-linux-gnu/libOSMesa.so.6 /opt/google/chrome/libosmesa.so \
&& ln -s /opt/google/chrome/google-chrome.real /opt/google/chrome/chrome \
&& ln -s /opt/google/chrome/google-chrome.real /usr/bin/chrome \
) || true \
&& [ $MACH != "x86_64" ] && ( \
echo "deb http://deb.debian.org/debian bookworm main" >> /etc/apt/sources.list.d/debian.list \
&& echo "deb http://deb.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list.d/debian.list \
&& echo 'Package: chromium*' >> /etc/apt/preferences.d/chromium.pref \
&& echo 'Pin: origin "ftp.debian.org"' >> /etc/apt/preferences.d/chromium.pref \
&& echo 'Pin-Priority: 700' >> /etc/apt/preferences.d/chromium.pref \
&& apt-get update; apt-get -fy install chromium; apt-get clean; rm -rf /var/lib/apt/lists/* \
&& mv /usr/bin/chromium /usr/bin/google-chrome.real \
) || true \
&& rm -f /etc/alternatives/google-chrome \
&& rm -f /usr/bin/google-chrome \
&& ln -s /usr/bin/xvfb-chromium /usr/bin/google-chrome \
&& ln -s /usr/bin/xvfb-chromium /etc/alternatives/google-chrome \
&& ln -s /usr/bin/xvfb-chromium /usr/bin/chromium-browser
# This may be desired, but breaks past behaviour
# https://github.com/trion-development/docker-ng-cli-karma/issues/23
# USER $USER_ID