Skip to content

Commit 1f7f037

Browse files
committed
make dockerfile compatible with arm arch
1 parent 23b5b59 commit 1f7f037

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
# base node image
22
FROM node:20-bookworm-slim
33

4+
ARG ARCH="arm64"
5+
46
# Copied from https://github.com/puppeteer/puppeteer/blob/aefbde60d7993c37ca5289e034f3ca90945c20ff/docker/Dockerfile#L6
57
#
68
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
79
# Note: this installs the necessary libs to make the bundled version of Chrome that Puppeteer
810
# installs, work.
911
RUN apt-get update \
1012
&& apt-get install -y wget gnupg \
11-
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \
12-
&& sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
13-
&& apt-get update \
14-
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \
13+
&& if [ $ARCH = 'arm64' ]; then \
14+
apt-get install -y chromium \
15+
; else \
16+
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \
17+
&& sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
18+
&& apt-get update \
19+
&& apt-get install -y google-chrome-stable \
20+
; fi \
21+
&& apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \
1522
--no-install-recommends \
1623
&& rm -rf /var/lib/apt/lists/*
1724

0 commit comments

Comments
 (0)