How use docker compose file to start a selenium grid when overlay network is concerned?

19 views
Skip to first unread message

tan...@akulaku.com

unread,
Jun 11, 2018, 10:29:49 PM6/11/18
to Selenium Users

I wish to use many machine to run selenium grid in docker, and I took a lot of efforts to make it.
here is my tracks
(1)I start hub and node on one machine, and i works
(2)I start hub and node on diffirent machine, I need to create an overlay network, and attach the node to the leader, and then the node can registered ,but the the hub fails to contact with the node, and I realized in the readme:
‘Some network topologies might prevent the hub to reach the node through the url given at registration time, REMOTE_HOST can be used to supply the hub a url where the node is reachable under your specific network configuration’

I guess that is my problem, so when I use the opts, it works
now I am somehow successed
I use the command like:
1)master
docker swarm init
node:
.....join......
2)matster:
docker network create -d overlay --attachable overlay_study
3)master:
docker run --rm -p 44440:4444 --network overlay_study --name hub1 selenium/hub:3.11.0
node:
docker run -it --rm --net overlay_study -e HUB_HOST=hub1 -e NODE_HOST=chrome1 --name chrome1 selenium/node-chrome

and now ,everything works fine,I can use this command, since docker use container name to be host name, and auto dns is on
but I still want more,I wish to make there like a stack, so I can write the command in a yaml and use
'docker stack deploy' one time in master rather than enter these command in every node.

but then I find my trick won't work because in a service, the replicas's host name is dynamic, the trick I used upon fails this way.

I don't know what to do now

Reply all
Reply to author
Forward
0 new messages