Selenium 无法在Docker容器中打开firefox

Selenium 无法在Docker容器中打开firefox,selenium,firefox,docker,dockerfile,Selenium,Firefox,Docker,Dockerfile,我试图在Docker容器中运行selenium测试。我在OracleLinux6.7的基础映像上创建了这个映像,上面有Firefox24。在同样运行selenium测试的入口点脚本中设置显示。但是当它运行测试时,它会错误地说 [java] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox cons

我试图在Docker容器中运行selenium测试。我在OracleLinux6.7的基础映像上创建了这个映像,上面有Firefox24。在同样运行selenium测试的入口点脚本中设置显示。但是当它运行测试时,它会错误地说

  [java] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
 [java] *** LOG addons.manager: Application has been upgraded
 [java] *** LOG addons.xpi: startup
 [java] *** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous9132988696593276996webdriver-profile/extensions/webdriver-staging
 [java] *** LOG addons.xpi: checkForChanges
 [java] *** LOG addons.xpi-utils: Opening database
 [java] *** LOG addons.xpi-utils: Creating database schema
 [java] *** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
 [java] *** Blocklist::_loadBlocklistFromFile: blocklist is disabled
 [java] *** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
 [java] *** LOG addons.xpi: Updating database with changes to installed add-ons
 [java] *** LOG addons.xpi-utils: Updating add-on states
 [java] *** LOG addons.xpi-utils: Writing add-ons list
 [java] *** LOG addons.manager: shutdown
 [java] *** LOG addons.xpi: shutdown
 [java] *** LOG addons.xpi-utils: shutdown
 [java] *** LOG addons.xpi-utils: Database closed
 [java] *** LOG addons.xpi: startup
 [java] *** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous9132988696593276996webdriver-profile/extensions/webdriver-staging
 [java] *** LOG addons.xpi: checkForChanges
 [java] *** LOG addons.xpi: No changes found
 [java] process 149: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
 [java] See the manual page for dbus-uuidgen to correct this issue.
 [java]   D-Bus not built with -rdynamic so unable to print a backtrace
这就是我在入口点脚本中设置显示的方式

#Set the Display
vncserver :1
export DISPLAY=:1
谁能告诉我我可能做错了什么

我所做的其他信息和疑难解答: 我认为这可能是Firefox和Selenium(使用Selenium 2.44.0和Firefox 24)的版本兼容性问题,但看起来不是

  • 当从我的虚拟机运行firefox和selenium的相同版本时,该测试运行良好。仅当我将其作为docker映像运行时失败
  • 试图将firefox版本升级到44,但没有帮助
  • 在我的docker文件中暴露了正确的端口。5900,5901,5902,5903.
    你在使用正式的docker回购协议吗?如果是,您正在运行什么版本和命令?不,我没有使用官方的repo。所以您没有使用项目。我从头开始构建映像。以Oracle Linux为基础,安装了包括firefox在内的其他相关软件包。暴露端口。指向入口点脚本。入口点脚本运行selenium测试。明白了。。我是selenium docker存储库的维护者,所以我想我会问:)不要认为我能帮你解决这个错误。以前从没见过。