Dustin Le
Dustin Le

Reputation: 161

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?

Upvotes: 16

Views: 10889

Answers (3)

drkr
drkr

Reputation: 446

For those who use Python with Playwright: playwright install-deps

Upvotes: 4

Mike Stop Continues
Mike Stop Continues

Reputation: 1233

With modern versions of playwright, you can easily add the necessary packages to any container with the following command:

npx playwright install-deps

This is much better than manually installing them because it will stay in sync with playwright updates.


Note: The previous answer, while technically correct, will bloat your container with a heavy layer that you probably don't need.

Upvotes: 15

Ashish Kirodian
Ashish Kirodian

Reputation: 946

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.

Upvotes: 2

Related Questions