I have a docker-compose file that I upgraded from version 1 to version 2.
It set ups a simple Selenium hub with a firefox node.
When I set it up as version 1 it launches fine. When I set it up with version 2 the ff container returns "Not linked with a running Hub container"
and exits.
As I researched it and understood it , is that the linkage between the containers somehow suffers.
Is there a solution ?? Am I missing something ??
version: '2'
services:
hub:
container_name: hub
image: selenium/hub
ports:
- "8080:4444" # HOST:CONTAINER
expose:
- "4444"
ff:
container_name: ff
image: selenium/node-firefox
links:
- hub
expose:
- "5555"
Add an environment variable to your
ff
section of the Docker Compose file (and you can remove the link):Compose version 2 uses a different style of networking. From the upgrading guide:
From the networking documentation:
The Selenium dockerfile uses version 1 style networking by ENV variable. Here in the code, if that variable isn't set (which Docker used to do) the entry_point.sh command exits. Providing the variable explicitly solves this.
Below compose file working for me
command I use:
Source :
https://github.com/SeleniumHQ/docker-selenium