-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
46 lines (39 loc) · 1.94 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
FROM trion/ng-cli:latest
ARG CHROME_VERSION=<unset> USER_ID=1000
LABEL chrome=$CHROME_VERSION ng-cli='18.2.11'
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-get -fy install; rm google-chrome-stable_current_amd64.deb; apt-get clean; rm -rf /var/lib/apt/lists/* ) \
&& mv /usr/bin/google-chrome /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 \
) || true \
&& [ $MACH != "x86_64" ] && ( \
echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/sources.list.d/debian.list \
&& echo "deb http://deb.debian.org/debian buster-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 \
&& ln -s /opt/google/chrome/google-chrome.real /etc/alternatives/google-chrome \
&& ln -s /usr/bin/xvfb-chromium /usr/bin/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