Skip to content

Commit a1376bb

Browse files
authored
update: fetch latest Geckodriver via GH api
1 parent 8bada80 commit a1376bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

NodeFirefox/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
3131
# GeckoDriver
3232
#============
3333
ARG GECKODRIVER_VERSION=latest
34-
RUN DRIVER_ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "linux64"; else echo "linux-aarch64"; fi) \
35-
&& GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.34.0"; else echo $GECKODRIVER_VERSION; fi) \
34+
RUN if LATEST_VERSION=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.tag_name') \
35+
&& DRIVER_ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "linux64"; else echo "linux-aarch64"; fi) \
36+
&& GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "${LATEST_VERSION}"; else echo $GECKODRIVER_VERSION; fi) \
3637
&& echo "Using GeckoDriver version: "$GK_VERSION \
37-
&& 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 \
38+
&& wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/${GK_VERSION}/geckodriver-${GK_VERSION}-${DRIVER_ARCH}.tar.gz \
3839
&& rm -rf /opt/geckodriver \
3940
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
4041
&& rm /tmp/geckodriver.tar.gz \

0 commit comments

Comments
 (0)