You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2022/10/09 14:38:47 UTC

[whimsy] branch master updated: Chrome not available on arm64 - use chromium

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 04cada1b Chrome not available on arm64 - use chromium
04cada1b is described below

commit 04cada1b8faa03293ffb28426ff8726f3b07c3dc
Author: Sebb <se...@apache.org>
AuthorDate: Sun Oct 9 15:38:37 2022 +0100

    Chrome not available on arm64 - use chromium
---
 Dockerfile                         |  6 ++----
 docker-config/puppeteer-install.sh | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index e7692af3..d22c7ff9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -64,10 +64,8 @@ RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y vim
 RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y ldap-utils
 
 # Install puppeteer
-RUN curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
-RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
-RUN apt update && apt install -y google-chrome-stable
-RUN npm install -g puppeteer --unsafe-perm=true
+COPY docker-config/puppeteer-install.sh /tmp/puppeteer-install.sh
+RUN bash /tmp/puppeteer-install.sh && rm /tmp/puppeteer-install.sh
 
 #  For testing agenda, you may need the following:
 # Find the chrome version:
diff --git a/docker-config/puppeteer-install.sh b/docker-config/puppeteer-install.sh
new file mode 100755
index 00000000..d603280e
--- /dev/null
+++ b/docker-config/puppeteer-install.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# Install puppeteer
+
+# First install chrome or chromium (on arm64)
+
+case "$(dpkg --print-architecture)" in
+    arm64)
+        apt install -y chromium-browser
+    ;;
+    *)
+        curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
+        echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
+        apt update && apt install -y google-chrome-stable
+    ;;
+esac
+
+npm install -g puppeteer --unsafe-perm=true