Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Docker image future features #3791

Closed
2 of 4 tasks
mxschmitt opened this issue Sep 8, 2020 · 3 comments
Closed
2 of 4 tasks

[Feature] Docker image future features #3791

mxschmitt opened this issue Sep 8, 2020 · 3 comments
Assignees

Comments

@mxschmitt
Copy link
Member

mxschmitt commented Sep 8, 2020

Issue about which changes in the Docker image are needed / requested by the community.

aslushnikov pushed a commit that referenced this issue Sep 21, 2020
Each Ubuntu and Debian release has a code name. Ubuntu 18(bionic), Ubuntu 20(focal). This adds the Dockerfile for Ubuntu20.
Next steps and follow up changes:
- add it to the devops site, so we are sure all tests are passing, locally they did
- deploy it to the MCR, naming needs to be clarified, probably just as "focal".

This naming schema allows us in the future to add Debian support too. But we should wait until Headless WK is fixed.

Relates #3791
Relates #2758
Closes #3338
aslushnikov pushed a commit that referenced this issue Sep 23, 2020
This will end up in the following Docker tags:
- focal <- new
- bionic < old as before
- latest <- old as before, keep bionic for now until EOL is reached
- v1.4 <- old as before, is bionic
- v1.4-focal <- new, is focal

Depends on aslushnikov/devops.aslushnikov.com#3 to ensure it works.
Relates to #3791.
@domderen
Copy link
Contributor

I think this could work as a base image for Playwright-Python:

FROM python:3.7-buster

# 1. Install WebKit dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    libwoff1 \
    libopus0 \
    libwebp6 \
    libwebpdemux2 \
    libenchant1c2a \
    libgudev-1.0-0 \
    libsecret-1-0 \
    libhyphen0 \
    libgdk-pixbuf2.0-0 \
    libegl1 \
    libnotify4 \
    libxslt1.1 \
    libevent-2.1-6 \
    libgles2 \
    libvpx5 \
    libxcomposite1 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libepoxy0 \
    libgtk-3-0 \
    libharfbuzz-icu0

# 2. Install gstreamer and plugins to support video playback in WebKit.
RUN apt-get update && apt-get install -y --no-install-recommends \
    libgstreamer-gl1.0-0 \
    libgstreamer-plugins-bad1.0-0 \
    gstreamer1.0-plugins-good \
    gstreamer1.0-libav

# 3. Install Chromium dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    libnss3 \
    libxss1 \
    libasound2 \
    fonts-noto-color-emoji \
    libxtst6

# 4. Install Firefox dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    libdbus-glib-1-2 \
    libxt6

# 5. Install ffmpeg to bring in audio and video codecs necessary for playing videos in Firefox.
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg

# 6. (Optional) Install XVFB if there's a need to run browsers in headful mode
RUN apt-get update && apt-get install -y --no-install-recommends \
    xvfb

# 7. Install playwright for python
RUN pip install playwright

# 8. Download browsers into the image
RUN python -m playwright install

Though I'm assuming you might want to customize it with user defined Python version? For example create those base images for different Python/Playwright versions. What do you think about that?

@domderen
Copy link
Contributor

Here's a PR that would generate Python 3.7 & Python 3.8 docker images with Playwright-Python baked in: microsoft/playwright-python#197

At the moment it attempts to run unit tests before building the docker image, and those fail inside docker, so needs further investigation.

@pavelfeldman
Copy link
Member

Looks like it is now tracked in Python land, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants