docker 中安装chrome和grid
- 安装完成docker后启动docker
启动hub:docker run -d -p 4440-4450:4440-4450 --net hub4 --name selenium-hub selenium/hub
启动node节点:
docker run -d --name node1 --net hub4 -e SE_EVENT_BUS_HOST=selenium-hub --shm-size=2g -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome
docker run -d --name node2 --net hub4 -e SE_EVENT_BUS_HOST=selenium-hub --shm-size=2g -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome
docker run -d --name node3 --net hub4 -e SE_EVENT_BUS_HOST=selenium-hub --shm-size=2g -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome
docker run -d --name node4 --net hub4 -e SE_EVENT_BUS_HOST=selenium-hub --shm-size=2g -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome
docker run -d --name node5 --net hub4 -e SE_EVENT_BUS_HOST=selenium-hub --shm-size=2g -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome
-
验证地址:http://127.0.0.1:4444