'docker-compose selenium grid

I'm using docker-compose version 2 to build a local selenium grid, and I'm running into trouble.

Most of my trouble is coming from a lot of old blogs/documentation and trying to build this using new documentation, with little practical reference (eg: no newer blogs). From my understanding, this should work but it's not.

Here's my docker-compose.yml file:

version: '2.0'
services:
  grid-hub:
    image: 'selenium/hub'
    ports:
      - '4444:4444'
  node-chrome-debug:
    image: 'selenium/node-chrome-debug'
    depends_on:
      - 'grid-hub'
    environment:
      - HUB_PORT_4444_TCP_ADDR=grid-hub

Here's the output of my node, which never gets past this to register with the hub:

Waiting xvfb...
-bash: 169.254/16: No such file or directory
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...

I've been scouring the Dockerfile on github, and I thought maybe I was missing an environment variable but I can't find what I'm missing.

Here's an update: I've tried specifying the port via - HUB_PORT_4444_TCP_PORT=4444, but this has had no effect. I've opened an issue on github to increase visibility, but this also includes my docker version which I'll include here.

Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      linux/amd64
 Experimental: true


Solution 1:[1]

Based on the comment by ddavison from a pending pull request

On OSX, there are some environment variables being set that shouldn't be. By setting no_proxy we circumvent the issue.

version: '3.0'
services:
  grid-hub:
    container_name: 'grid-hub'
    image: 'selenium/hub'
    ports:
      - '4444:4444'
  node-chrome-debug:
    image: 'selenium/node-chrome-debug'
    depends_on:
      - 'grid-hub'
    environment:
      - HUB_PORT_4444_TCP_ADDR=grid-hub
      - HUB_PORT_4444_TCP_PORT=4444
      - no_proxy=""

Solution 2:[2]

I would suggest you to use the below docker-compose config

version: "3"
services:
  hub:
    image: selenium/hub:4.1.3
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"

  chrome:
    image: selenium/node-chrome:4.1.3
    shm_size: '3gb'
    depends_on:
      - hub
    links:
      - hub
    environment:
      - SE_EVENT_BUS_HOST=hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - VNC_NO_PASSWORD=1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paul FREAKN Baker
Solution 2 Uchiha Suryajit