无法在Docker容器中打开Firefox

我正试图在Docker容器中运行一个seleniumtesting。 我在Oracle Linux 6.7的基础映像上创build了映像,并在其上安装了firefox 24。 在运行seleniumtesting的入口点脚本中设置Display。 但是,当它运行testing时,它错误地说

[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(使用selenium2.44.0和Firefox 24)的版本兼容性问题,但看起来不是。

  1. 这个testing在我的虚拟机上运行时使用相同版本的firefox和selenium运行良好。 只有当我运行它作为docker的图像失败。
  2. 试图升级到44的Firefox版本,但没有帮助。
  3. 在我的docker文件中暴露正确的端口。 5900,5901,5902,5903。