2020-12-08 14:00:57 -08:00
|
|
|
FROM ubuntu:focal
|
|
|
|
|
|
|
|
# === INSTALL JDK and Maven ===
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2021-03-23 17:49:02 -07:00
|
|
|
openjdk-11-jdk maven
|
2021-03-22 16:31:52 -07:00
|
|
|
|
2021-03-23 17:49:02 -07:00
|
|
|
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
|
2020-12-08 14:00:57 -08:00
|
|
|
|
|
|
|
# Install utilities required for downloading driver
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
curl unzip
|
|
|
|
|
2021-03-23 17:49:02 -07:00
|
|
|
# === INSTALL playwright maven modules & browsers ===
|
|
|
|
|
|
|
|
# Browsers will remain downloaded in `/ms-playwright`.
|
|
|
|
# Note: make sure to set 777 to the registry so that any user can access
|
|
|
|
# registry.
|
|
|
|
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
|
|
|
|
|
|
RUN mkdir /ms-playwright && chmod -R 777 $PLAYWRIGHT_BROWSERS_PATH
|
2020-12-08 14:00:57 -08:00
|
|
|
|
|
|
|
RUN mkdir /tmp/pw-java
|
|
|
|
COPY . /tmp/pw-java
|
2021-03-23 17:49:02 -07:00
|
|
|
RUN cd /tmp/pw-java && \
|
|
|
|
./scripts/download_driver_for_all_platforms.sh && \
|
2021-01-07 02:23:53 +08:00
|
|
|
mvn install -D skipTests --no-transfer-progress && \
|
2021-03-30 13:09:14 -07:00
|
|
|
DEBIAN_FRONTEND=noninteractive mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \
|
|
|
|
-D exec.args="install-deps" -f playwright/pom.xml --no-transfer-progress && \
|
2021-03-24 13:56:18 -07:00
|
|
|
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \
|
|
|
|
-D exec.args="install" -f playwright/pom.xml --no-transfer-progress && \
|
2020-12-09 22:37:13 +05:30
|
|
|
rm -rf /tmp/pw-java
|