From 550313d2fd0a8c0c1f9807de58bccdd484e23eb8 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 1 Oct 2024 09:40:20 +0200 Subject: [PATCH] cherry-pick(#1679): devops: use wget for driver downloads --- scripts/download_driver.sh | 8 +++++++- utils/docker/Dockerfile.focal | 4 ++-- utils/docker/Dockerfile.jammy | 4 ++-- utils/docker/Dockerfile.noble | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/download_driver.sh b/scripts/download_driver.sh index c7dc1979..17d1d92c 100755 --- a/scripts/download_driver.sh +++ b/scripts/download_driver.sh @@ -45,7 +45,13 @@ do fi URL=$URL/$FILE_NAME echo "Using url: $URL" - curl -O $URL + # Ubuntu 24.04-arm64 emulated via qemu has a bug, so we prefer wget over curl. + # See https://github.com/microsoft/playwright-java/issues/1678. + if command -v wget &> /dev/null; then + wget $URL + else + curl -O $URL + fi unzip $FILE_NAME -d . rm $FILE_NAME diff --git a/utils/docker/Dockerfile.focal b/utils/docker/Dockerfile.focal index 4e598b30..5a719cd3 100644 --- a/utils/docker/Dockerfile.focal +++ b/utils/docker/Dockerfile.focal @@ -9,7 +9,7 @@ ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/java:v%version%-foc RUN apt-get update && \ apt-get install -y --no-install-recommends openjdk-21-jdk \ # Install utilities required for downloading browsers - curl \ + wget \ # Install utilities required for downloading driver unzip \ # For the MSEdge install script @@ -21,7 +21,7 @@ RUN apt-get update && \ # Ubuntu 22.04 and earlier come with Maven 3.6.3 which fails with # Java 21, so we install latest Maven from Apache instead. RUN VERSION=3.9.6 && \ - curl -o - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ + wget -O - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ ln -s /opt/apache-maven-$VERSION/bin/mvn /usr/local/bin/ ARG PW_TARGET_ARCH diff --git a/utils/docker/Dockerfile.jammy b/utils/docker/Dockerfile.jammy index 3f5e4546..4e6ea2c5 100644 --- a/utils/docker/Dockerfile.jammy +++ b/utils/docker/Dockerfile.jammy @@ -9,7 +9,7 @@ ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/java:v%version%-jam RUN apt-get update && \ apt-get install -y --no-install-recommends openjdk-21-jdk \ # Install utilities required for downloading browsers - curl \ + wget \ # Install utilities required for downloading driver unzip \ # For the MSEdge install script @@ -21,7 +21,7 @@ RUN apt-get update && \ # Ubuntu 22.04 and earlier come with Maven 3.6.3 which fails with # Java 21, so we install latest Maven from Apache instead. RUN VERSION=3.9.6 && \ - curl -o - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ + wget -O - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ ln -s /opt/apache-maven-$VERSION/bin/mvn /usr/local/bin/ ARG PW_TARGET_ARCH diff --git a/utils/docker/Dockerfile.noble b/utils/docker/Dockerfile.noble index e93c5b28..f006b419 100644 --- a/utils/docker/Dockerfile.noble +++ b/utils/docker/Dockerfile.noble @@ -9,7 +9,7 @@ ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/java:v%version%-nob RUN apt-get update && \ apt-get install -y --no-install-recommends openjdk-21-jdk \ # Install utilities required for downloading browsers - curl \ + wget \ # Install utilities required for downloading driver unzip \ # For the MSEdge install script @@ -21,7 +21,7 @@ RUN apt-get update && \ # Ubuntu 22.04 and earlier come with Maven 3.6.3 which fails with # Java 21, so we install latest Maven from Apache instead. RUN VERSION=3.9.6 && \ - curl -o - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ + wget -O - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ ln -s /opt/apache-maven-$VERSION/bin/mvn /usr/local/bin/ ARG PW_TARGET_ARCH