Skip to content

Commit

Permalink
cherry-pick(#1679): devops: use wget for driver downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Oct 1, 2024
1 parent bb0f48e commit 550313d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion scripts/download_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions utils/docker/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions utils/docker/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions utils/docker/Dockerfile.noble
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 550313d

Please sign in to comment.