我可以通过以下方式启动硒集线器图像:
docker run --rm=true -P -p 4444:4444 --name selenium-hub selenium/hub
并通过以下方式添加 Firefox Worker:
docker run --rm=true --link selenium-hub:hub selenium/node-firefox
正在进行中http://localhost:4444/grid/console http://localhost:4444/grid/console然后就会很好地显示网格。
我不想每次都使用 docker,但通过以下方式进行相同的设置docker-compose
.
因此,我想我可以在我的docker-compose.yml
:
selenium_hub:
image: selenium/hub
ports: ["4444:4444"]
links:
- selenium_firefox_worker
selenium_firefox_worker:
image: selenium/node-firefox
然而跑完之后docker-compose up
我收到消息:
selenium_firefox_node_1 | Not linked with a running Hub container
selenium_firefox_node_1 exited with code 1
因此网格不显示任何节点。
我认为我可能以错误的顺序进行链接,但甚至:
selenium_hub:
image: selenium/hub
ports: ["4444:4444"]
selenium_firefox_node:
image: selenium/node-firefox
links:
- selenium_hub
产生相同的错误。
我究竟做错了什么?