openjdk:12-jdk docker容器缺少libX11.so.6库

4
我有一个Dockerfile,它来自openjdk-12-jdk。在我的应用程序中,一个依赖项 (https://github.com/bonigarcia/webdrivermanager) 显然需要libX11.so.6库,因为应用程序启动失败,显示如下错误信息:

/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

我尝试了yum whatprovides libX11.so.6,得到了以下返回结果:

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

所以我在Dockerfile中添加了 RUN yum -y install libX11-1.6.5-1.el7.i686
但错误仍然存在,并且与上述相同的错误导致失败。
因此,我尝试在容器内直接使用yum install libX11.i686,但是对于该应用程序仍然没有成功。
我该如何获得这个库?或者在openjdk-12-jdk docker基础上进行的oraclelinux中不可能吗?
===== 编辑内容 ====
当我尝试启动selenium测试的chromedriver时,我也尝试以headless方式调用它,但仍然出现相同的错误。

我解决了我的问题,虽然不确定这是否是一个有效的答案。我从 openjdk-12-jdk 切换到 centos,并手动安装了 openjdk。 我安装了 Google Chrome 并在无头模式下启动了我的测试。这是我的解决方法,但并不是实际问题的答案。 - Emerson Cod
1个回答

3

使用以下命令添加缺失组件:

yum -y install libX11

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接