From 9de0a5a963ca1a28ed89bf394516508274369676 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 27 Jan 2021 08:51:51 -0800 Subject: [PATCH] chore: add Python to docker images (#5139) This adds +100MB to network transfer size but enables our users to use playwright-python from-inside docker container. --- utils/docker/Dockerfile.bionic | 6 ++++++ utils/docker/Dockerfile.focal | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/utils/docker/Dockerfile.bionic b/utils/docker/Dockerfile.bionic index 6e9179e394..26521f822d 100644 --- a/utils/docker/Dockerfile.bionic +++ b/utils/docker/Dockerfile.bionic @@ -68,6 +68,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends git ssh && \ # 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 + # === BAKE BROWSERS INTO IMAGE === # 1. Add tip-of-tree Playwright package to install its browsers. diff --git a/utils/docker/Dockerfile.focal b/utils/docker/Dockerfile.focal index 080789b5e6..86daaad8a7 100644 --- a/utils/docker/Dockerfile.focal +++ b/utils/docker/Dockerfile.focal @@ -67,6 +67,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends git ssh && \ # 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 + # === BAKE BROWSERS INTO IMAGE === # 1. Add tip-of-tree Playwright package to install its browsers.