diff --git a/timApp/Dockerfile b/timApp/Dockerfile index 08c05f494c..178705b05e 100755 --- a/timApp/Dockerfile +++ b/timApp/Dockerfile @@ -174,7 +174,7 @@ RUN sed -i "s/port=port, use_reloader=False/host='0.0.0.0', port=port, use_reloa # Fix newest Werkzeug incompatibility RUN sed -i "s/from werkzeug import cached_property/from werkzeug.utils import cached_property/" /usr/local/lib/${PYTHON}/dist-packages/flask_testing/utils.py -RUN wget -q http://mirrors.ctan.org/support/latexmk/latexmk.pl -O /usr/bin/latexmk +RUN wget -q https://www.texlive.info/CTAN/support/latexmk/latexmk.pl -O /usr/bin/latexmk # Chromedriver (for running tests) # Taken from https://github.com/SeleniumHQ/docker-selenium/blob/trunk/NodeChrome/Dockerfile @@ -191,16 +191,25 @@ RUN wget -q https://raw.githubusercontent.com/SeleniumHQ/docker-selenium/trunk/N RUN /usr/local/bin/wrap_chrome_binary ARG CHROME_DRIVER_VERSION -RUN if [ -z "$CHROME_DRIVER_VERSION" ]; \ - then CHROME_MAJOR_VERSION=$(google-chrome --version | sed -E "s/.* ([0-9]+)(\.[0-9]+){3}.*/\1/") \ - && CHROME_DRIVER_VERSION=$(wget --no-verbose -O - "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION}"); \ +RUN bash -c "${APT_INSTALL} jq && ${APT_CLEANUP}" +RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \ + then CHROME_DRIVER_URL=https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip ; \ + else echo "Geting ChromeDriver binary from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" \ + && CFT_URL=https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json \ + && CFT_CHANNEL="Stable" \ + && if [ "$(echo "$CHROME_VERSION" | grep -q "beta")" ]; then CFT_CHANNEL="Beta"; fi \ + && if [ "$(echo "$CHROME_VERSION" | grep -q "unstable")" ]; then CFT_CHANNEL="Dev"; fi \ + && CTF_VALUES=$(curl -sSL $CFT_URL | jq -r --arg CFT_CHANNEL "$CFT_CHANNEL" '.channels[] | select (.channel==$CFT_CHANNEL)') \ + && CHROME_DRIVER_VERSION=$(echo $CTF_VALUES | jq -r '.version' ) \ + && CHROME_DRIVER_URL=$(echo $CTF_VALUES | jq -r '.downloads.chromedriver[] | select(.platform=="linux64") | .url' ) ; \ fi \ - && echo "Using chromedriver version: "$CHROME_DRIVER_VERSION \ - && wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \ + && echo "Using ChromeDriver from: "$CHROME_DRIVER_URL \ + && echo "Using ChromeDriver version: "$CHROME_DRIVER_VERSION \ + && wget --no-verbose -O /tmp/chromedriver_linux64.zip $CHROME_DRIVER_URL \ && rm -rf /opt/selenium/chromedriver \ && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ && rm /tmp/chromedriver_linux64.zip \ - && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ + && mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver