Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

missing dependencies when running playwright in docker

I tried to run the playwright in docker but got this error:

browserType.launch: Host system is missing dependencies!

Missing libraries are:
  libvpx.so.6
  libicui18n.so.66
  libicuuc.so.66
  libwoff2dec.so.1.0.2
  libharfbuzz-icu.so.0
  libgstgl-1.0.so.0
  libgstcodecparsers-1.0.so.0
  libjpeg.so.8
  libenchant.so.1
  libsecret-1.so.0
  libhyphen.so.0
  libGLESv2.so.2

Then I tried to install the necessary libs to make the bundled version of playwright work by adding:

RUN apt-get update && apt-get install -y wget --no-install-recommends \
    && apt-get update \
    && apt-get install -y \
    libvpx6 \
    lib64icui18n66 \
    libicuuc66 \
    ....

But I still get these errors:

E: Unable to locate package libvpx6 // I tried with libvpx5 but got the same error
E: Unable to locate package lib64icui18n66
E: Unable to locate package libicuuc66
....

Docker OS

Distributor ID: Debian
Description:    Debian GNU/Linux 9.13 (stretch)
Release:        9.13
Codename:       stretch

Anyone can help?

like image 658
Dustin Le Avatar asked Nov 07 '22 03:11

Dustin Le


1 Answers

Add this to your docker file

FROM mcr.microsoft.com/playwright:v1.6.2-focal

The above command should add all those missing dependencies to launch the tests.

like image 139
Ashish Kirodian Avatar answered Nov 14 '22 22:11

Ashish Kirodian