devika icon indicating copy to clipboard operation
devika copied to clipboard

install playwright browsers as user

Open jmtatsch opened this issue 1 year ago • 4 comments

fixes #297

jmtatsch avatar Apr 03 '24 09:04 jmtatsch

have you tested it perfectly? is it working

ARajgor avatar Apr 03 '24 20:04 ARajgor

Yes, i have built the container numerous times - with this fix in it just builds flawlessly. Web search also works.

jmtatsch avatar Apr 04 '24 04:04 jmtatsch

Shouldn't it be playwright install --with-deps because it also in the README?

KenAijmNight avatar Apr 04 '24 09:04 KenAijmNight

playwright install --with-deps installs both deps and all browsers but requires root privileges. As we create a nonroot user in the container that user doesn't have the installed browser naturally on its path. so we either need to change the PATH or install the browser as user.

jmtatsch avatar Apr 04 '24 11:04 jmtatsch

I got this while trying to run the command : playwright install --with-deps

BEWARE: your OS is not officially supported by Playwright; installing dependencies for Ubuntu as a fallback. Installing dependencies... Hit:1 https://brave-browser-apt-nightly.s3.brave.com stable InRelease Hit:2 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:3 http://http.kali.org/kali kali-rolling InRelease
Hit:4 https://repo.protonvpn.com/debian stable InRelease
Hit:5 https://packages.microsoft.com/debian/12/prod bookworm InRelease Hit:6 https://packages.microsoft.com/repos/code stable InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'libfontconfig1' instead of 'libfontconfig' Package ttf-ubuntu-font-family is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

Package libicu66 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

Package ttf-unifont is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: fonts-unifont

Package libjpeg-turbo8 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'ttf-unifont' has no installation candidate E: Package 'ttf-ubuntu-font-family' has no installation candidate E: Unable to locate package libx264-155 E: Unable to locate package libenchant1c2a E: Package 'libicu66' has no installation candidate E: Package 'libjpeg-turbo8' has no installation candidate E: Unable to locate package libvpx6 E: Unable to locate package libwebp6 Failed to install browsers Error: Installation process exited with code: 100

yassine017 avatar Apr 05 '24 06:04 yassine017

@yassine017 I just rebuilt the images from scratch and couldn't reproduce your issue I built like this docker compose build --progress=plain --no-cache how exactly are you building your image?

nevertheless there seem to be some issues installing playwright on non ubuntu systems https://github.com/microsoft/playwright/issues/13530 we could either switch to a ubuntu base image ubuntu:latest or add some more sources for the font packages RUN echo "deb http://ftp.us.debian.org/debian bookworm main non-free" >> /etc/apt/sources.list.d/fonts.list

jmtatsch avatar Apr 07 '24 07:04 jmtatsch

Is it ready to merge?

ARajgor avatar Apr 12 '24 03:04 ARajgor

imho yes

jmtatsch avatar Apr 12 '24 03:04 jmtatsch