playwright/utils/docker/Dockerfile.bionic
Andrey Lushnikov a6421c690b
devops: add missing fonts to docker (#7435)
These fonts are taken from Selenium docker image:

77db00ced0/NodeBase/Dockerfile (L57-L89)

Fixes #6907
2021-07-01 23:29:33 -07:00

72 lines
2.3 KiB
Docker

FROM ubuntu:bionic
# === INSTALL Node.js ===
# Install node14
RUN apt-get update && apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# Feature-parity with node.js base images.
RUN apt-get update && apt-get install -y --no-install-recommends git ssh && \
npm install -g yarn
# Create the pwuser (we internally create a symlink for the pwuser and the root user)
RUN adduser pwuser
# Install Python 3.8
RUN apt-get update && apt-get install -y python3.8 python3-pip && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
#================
# Font libraries
#================
# libfontconfig ~1 MB
# libfreetype6 ~1 MB
# xfonts-cyrillic ~2 MB
# xfonts-scalable ~2 MB
# fonts-liberation ~3 MB
# fonts-ipafont-gothic ~13 MB
# fonts-wqy-zenhei ~17 MB
# fonts-tlwg-loma-otf ~300 KB
# ttf-ubuntu-font-family ~5 MB
#
# Layer size: small: 36.28 MB (with --no-install-recommends)
# Layer size: small: 36.28 MB
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
libfontconfig \
libfreetype6 \
xfonts-cyrillic \
xfonts-scalable \
fonts-liberation \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-tlwg-loma-otf \
ttf-ubuntu-font-family \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -qyy clean
# === BAKE BROWSERS INTO IMAGE ===
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
ENV DEBIAN_FRONTEND=noninteractive
# 1. Add tip-of-tree Playwright package to install its browsers.
# The package should be built beforehand from tip-of-tree Playwright.
COPY ./playwright.tar.gz /tmp/playwright.tar.gz
# 2. Install playwright and then delete the installation.
# Browsers will remain downloaded in `/ms-playwright`.
# Note: make sure to set 777 to the registry so that any user can access
# registry.
RUN mkdir /ms-playwright && \
mkdir /tmp/pw && cd /tmp/pw && npm init -y && \
npm i /tmp/playwright.tar.gz && \
DEBIAN_FRONTEND=noninteractive npx playwright install-deps && \
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz && \
chmod -R 777 /ms-playwright