diff --git a/Dockerfile b/Dockerfile index 0497e754..6bbcac01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,11 +32,13 @@ RUN FIREFOX_URI="https://download.mozilla.org/?product=firefox-latest&os=linux64 ln -s /usr/local/firefox/firefox /usr/local/bin/firefox # Install Geckodriver -RUN GECKODRIVER_URL=https://github.com/mozilla/geckodriver/releases/download && \ - VERSION=$(curl -sL https://api.github.com/repos/mozilla/geckodriver/releases/latest | \ - grep tag_name | cut -d '"' -f 4) && \ - curl -sL "$GECKODRIVER_URL/$VERSION/geckodriver-$VERSION-linux64.tar.gz" | \ - tar -xz -C /usr/local/bin +RUN GECKODRIVER_META="https://api.github.com/repos/mozilla/geckodriver/releases/latest" && \ + GECKODRIVER_LATEST_RELEASE_URL=$(curl $GECKODRIVER_META | jq -r ".assets[] | select(.content_type==\"application/gzip\") | select(.name | test(\"linux64\")) | .browser_download_url") && \ + curl --silent --show-error --location --fail --retry 3 --output /tmp/geckodriver_linux64.tar.gz "$GECKODRIVER_LATEST_RELEASE_URL" && \ + cd /tmp && \ + tar xf geckodriver_linux64.tar.gz && \ + chmod +x geckodriver && \ + mv geckodriver /usr/local/bin/ WORKDIR /etaoin COPY ./ ./