Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

missing library libX11.so.6 for openjdk:12-jdk docker container

I have a Dockerfile that is from openjdk-12-jdk. In my application a dependency (https://github.com/bonigarcia/webdrivermanager) apperently requires the libX11.so.6 library, as the application fails to start with

/usr/src/app/etc/chromedriver/linux64/75.0.3770.8/chromdriver: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

I tried yum whatprovides libX11.so.6, which returned

bash-4.2# yum whatprovides libX11.so.6
Loaded plugins: ovl
libX11-1.6.5-1.el7.i686 : Core X11 protocol client library
Repo        : ol7_latest
Matched from:
Provides    : libX11.so.6



libX11-1.6.5-2.el7.i686 : Core X11 protocol client library
Repo        : ol7_latest
Matched from:
Provides    : libX11.so.6



libX11-1.6.5-1.el7.i686 : Core X11 protocol client library
Repo        : @ol7_latest
Matched from:
Provides    : libX11.so.6

So I added RUN yum -y install libX11-1.6.5-1.el7.i686 to my Dockerfile.

But the error remains and it still fails with the same error as written above.

So I tried yum install libX11.i686 directly inside of the container, but again with no success for the application

How can I get this library ? Or is this not possible with the oraclelinux, that is the basis of the openjdk-12-jdk docker ?

===== EDIT ====

as I try to start chromedriver for a selenium test, I also tried to call it headless, but also the same error occurrs

like image 313
Emerson Cod Avatar asked Sep 06 '25 03:09

Emerson Cod


1 Answers

Use the following command to add missing component:

yum -y install libX11
like image 148
VaL Avatar answered Sep 07 '25 19:09

VaL