Skip to content

Commit

Permalink
build: support download older Chrome version (#2216)
Browse files Browse the repository at this point in the history
E.g: given --build-arg CHROME_VERSION=google-chrome-stable_119.0.6045.159-1

Find list versions at https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Apr 19, 2024
1 parent 55e05b1 commit 4eb816a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions NodeChrome/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ USER root
# google-chrome-unstable
#============================================
ARG CHROME_VERSION="google-chrome-stable"
ARG TARGETARCH=amd64
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | tee /etc/apt/trusted.gpg.d/google.gpg >/dev/null \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
${CHROME_VERSION:-google-chrome-stable} \
&& if echo "${CHROME_VERSION}" | grep -qE "google-chrome-stable_[0-9]*"; \
then \
wget -qO google-chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}_${TARGETARCH}.deb" \
&& apt-get -qqy --no-install-recommends install --allow-downgrades ./google-chrome.deb \
&& rm -rf google-chrome.deb ; \
else \
apt-get -qqy --no-install-recommends install ${CHROME_VERSION} ; \
fi \
&& rm /etc/apt/sources.list.d/google-chrome.list \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

Expand Down

0 comments on commit 4eb816a

Please sign in to comment.