-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devops: add Ubuntu 24.04 (noble) Docker images (#2521)
- Loading branch information
Showing
4 changed files
with
72 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM ubuntu:noble | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG TZ=America/Los_Angeles | ||
ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/python:v%version%-noble" | ||
|
||
# === INSTALL Python === | ||
|
||
RUN apt-get update && \ | ||
# Install Python | ||
apt-get install -y python3 curl && \ | ||
# Align with upstream Python image and don't be externally managed: | ||
# https://github.com/docker-library/python/issues/948 | ||
rm /usr/lib/python3.12/EXTERNALLY-MANAGED && \ | ||
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \ | ||
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ | ||
python get-pip.py && \ | ||
rm get-pip.py && \ | ||
# Feature-parity with node.js base images. | ||
apt-get install -y --no-install-recommends git openssh-client gpg && \ | ||
# clean apt cache | ||
rm -rf /var/lib/apt/lists/* && \ | ||
# Create the pwuser | ||
adduser pwuser | ||
|
||
# === BAKE BROWSERS INTO IMAGE === | ||
|
||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright | ||
|
||
# 1. Add tip-of-tree Playwright package to install its browsers. | ||
# The package should be built beforehand from tip-of-tree Playwright. | ||
COPY ./dist/*-manylinux*.whl /tmp/ | ||
|
||
# 2. Bake in browsers & deps. | ||
# Browsers will be 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 /ms-playwright-agent && \ | ||
cd /ms-playwright-agent && \ | ||
pip install virtualenv && \ | ||
virtualenv venv && \ | ||
. venv/bin/activate && \ | ||
# if its amd64 then install the manylinux1_x86_64 pip package | ||
if [ "$(uname -m)" = "x86_64" ]; then pip install /tmp/*manylinux1_x86_64*.whl; fi && \ | ||
# if its arm64 then install the manylinux1_aarch64 pip package | ||
if [ "$(uname -m)" = "aarch64" ]; then pip install /tmp/*manylinux_2_17_aarch64*.whl; fi && \ | ||
playwright mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \ | ||
playwright install --with-deps && rm -rf /var/lib/apt/lists/* && \ | ||
rm /tmp/*.whl && \ | ||
rm -rf /ms-playwright-agent && \ | ||
chmod -R 777 /ms-playwright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters