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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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


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:
docker swarm init
docker network create -d overlay --attachable overlay_study
docker run --rm -p 44440:4444 --network overlay_study --name hub1 selenium/hub:3.11.0
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

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit
For more options, visit