devika
devika copied to clipboard
install playwright browsers as user
fixes #297
have you tested it perfectly? is it working
Yes, i have built the container numerous times - with this fix in it just builds flawlessly. Web search also works.
Shouldn't it be playwright install --with-deps because it also in the README?
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.
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 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
Is it ready to merge?
imho yes