Skip to content

Commit

Permalink
update: fetch latest Geckodriver via GH api
Browse files Browse the repository at this point in the history
  • Loading branch information
VietND96 authored Aug 6, 2024
1 parent 8bada80 commit a1376bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions NodeFirefox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
# GeckoDriver
#============
ARG GECKODRIVER_VERSION=latest
RUN DRIVER_ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "linux64"; else echo "linux-aarch64"; fi) \
&& GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.34.0"; else echo $GECKODRIVER_VERSION; fi) \
RUN if LATEST_VERSION=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.tag_name') \
&& DRIVER_ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "linux64"; else echo "linux-aarch64"; fi) \
&& GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "${LATEST_VERSION}"; else echo $GECKODRIVER_VERSION; fi) \
&& echo "Using GeckoDriver version: "$GK_VERSION \
&& wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v${GK_VERSION}/geckodriver-v${GK_VERSION}-${DRIVER_ARCH}.tar.gz \
&& wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/${GK_VERSION}/geckodriver-${GK_VERSION}-${DRIVER_ARCH}.tar.gz \
&& rm -rf /opt/geckodriver \
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
&& rm /tmp/geckodriver.tar.gz \
Expand Down

0 comments on commit a1376bb

Please sign in to comment.