【发布时间】:2023-03-15 14:15:01
【问题描述】:
我有一个来自 openjdk-12-jdk 的 Dockerfile。在我的应用程序中,依赖项 (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,但应用程序再次没有成功
我怎样才能得到这个库?或者这对于oraclelinux 是不可能的,这是openjdk-12-jdk docker 的基础?
===== 编辑 ====
当我尝试启动 chromedriver 进行硒测试时,我也尝试将其称为无头,但也会发生相同的错误
【问题讨论】:
-
我解决了我的问题,但不确定这是否是一个有效的答案。我从
openjdk-12-jdk切换到centos 并手动安装了openjdk。我安装了谷歌浏览器并以无头模式开始我的测试。这是我的解决方法,但不是问题的实际答案
标签: java selenium docker webdriver yum