[我试图让docker在docker中运行一个Selenium / firefox独立容器,以便能够将其与R中的RSelenium
一起使用,并在我的raspberry pi 3 B +上做一些报废。我设法使docker启动并运行。 hello-world运行以及ubuntu bash都有效(docker run -it ubuntu bash
为我提供了ubuntu终端)。
我拉了最后一个独立的Firefox docker pull selenium/standalone-firefox
,它起作用了。当我从终端运行时
docker run -d -p selenium/standalone-firefox
它返回了我很长的数字,但是当我这样做的时候
docker ps
没有列出容器。我无法在R中获得RSelenium
与本地主机连接:
library(RSelenium)
remDr <- remoteDriver(remoteServerAddr = "localhost",port = 4445L, browserName = "firefox")
remDr$open()
Error in checkError(res)
Undefined error in httr call. httr output: Failed to connect to localhost port 4445: Connexion refused
这可与我的常规笔记本电脑配合使用。我在这里错了吗?
您没有完全使用docker。您实际上可以看到您的容器正在执行docker ps -a,但这不是很好。您指定了-p参数,并且未将任何端口传递给该参数。禁用该图像的官方文档,然后逐步尝试: