Skip to content

Commit cb285d9

Browse files
committed
chore: Update Dockerfile to support ARM64 architecture for Puppeteer
1 parent 83e634f commit cb285d9

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Dockerfile

+13-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,24 @@ WORKDIR /app
3030

3131
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
3232

33-
RUN apt-get update && apt-get install gnupg wget -y && \
33+
RUN ARCH=$(dpkg --print-architecture) && \
34+
if [ "$ARCH" = "amd64" ]; then \
3435
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
3536
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
3637
apt-get update && \
37-
apt-get install google-chrome-stable -y --no-install-recommends && \
38+
apt-get install google-chrome-stable -y --no-install-recommends; \
39+
elif [ "$ARCH" = "arm64" ]; then \
40+
wget -q -O - 'https://playwright.azureedge.net/builds/chromium/1088/chromium-linux-arm64.zip' && \
41+
unzip chromium-linux-arm64.zip && \
42+
mv chrome-linux /usr/bin/chromium-browser && \
43+
ln -s /usr/bin/chromium-browser /usr/bin/google-chrome && \
44+
rm chromium-linux-arm64.zip; \
45+
else \
46+
echo "Unsupported architecture: $ARCH" && exit 1; \
47+
fi && \
3848
rm -rf /var/lib/apt/lists/*
3949

50+
4051
RUN yarn config set registry https://registry.npmjs.org/
4152
RUN yarn config set network-timeout 1200000
4253

0 commit comments

Comments
 (0)