Run Chromium inside container: libGl error

2019-06-22 07:56发布

问题:

I'm trying to run Chromium inside docker container. Here's the output I get:

Created new window in existing browser session.
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: vmwgfx

I've searched a lot on the internet about this issue but cannot find anything clear. Do you have any suggestions on how can I solve this problem ?

Thank you in advance.

回答1:

As Mark Wragg wrote in a comment; this guide from wiki.ros.org is pretty good

It seems like you're missing the vmwgfx GL drivers, at mesa3d.org you can see how to install them.

Myself ran into this issue after all drivers was installed, but then I found out that I also need to mount the graphic card to the docker container. For Intel cards that's made with

docker run --device=/dev/dri:/dev/dri ...

For other graphic cards I recommend the guide from wiki.ros.org



回答2:

Do you realize that you can run as may unrelated instances of Chromium if you like with the --user-data-dir= option?

 chromium-browser --user-data-dir=/tmp/chrome1

Or

 chromium-browser --user-data-dir=`mktemp` &
 chromium-browser --user-data-dir=`mktemp` &
 chromium-browser --user-data-dir=`mktemp` &

The additional isolation that docker brings is thin compared to the security and isolation baked into Chrome.