Grid not working

Hi, I have tried following configuration but seems not working, can someone help please ?
yaml file :

# To execute this docker-compose yml file use `docker-compose -f <file_name> up`
# Add the `-d` flag at the end for detached execution

services:
  selenium-hub:
    image: selenium/hub:latest 
    container_name: selenium-hub
    ports:
      - "4444:4444"
  chrome:
    image: selenium/node-chrome:latest
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
  firefox:
    image: selenium/node-firefox:latest
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
cmd output
D:\devops\docker>docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE

D:\devops\docker>docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

D:\devops\docker>dir
 Volume in drive D is DATA
 Volume Serial Number is EEBB-D1D9

 Directory of D:\devops\docker

30.10.2025  15:51    <DIR>          .
30.10.2025  15:50    <DIR>          ..
30.10.2025  16:25               673 docker-compose.yaml
               1 File(s)            673 bytes
               2 Dir(s)  189 930 749 952 bytes free

D:\devops\docker>docker-compose up
[+] Running 20/44
 ✔ selenium-hub Pulled                                                                                            91.4s
 ✔ chrome Pulled                                                                                                 141.0s
 ✔ firefox Pulled                                                                                                138.4s

[+] Running 4/4
 ✔ Network docker_default      Created                                                                             0.3s
 ✔ Container selenium-hub      Created                                                                            10.1s
 ✔ Container docker-firefox-1  Created                                                                             2.3s
 ✔ Container docker-chrome-1   Created                                                                             2.3s
Attaching to chrome-1, firefox-1, selenium-hub
selenium-hub  | Virtual environment detected at /opt/venv, activating...
selenium-hub  | Python 3.12.3
selenium-hub  | 2025-10-30 15:28:59,043 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-hub.conf" during parsing
selenium-hub  | 2025-10-30 15:28:59,046 INFO RPC interface 'supervisor' initialized
selenium-hub  | 2025-10-30 15:28:59,047 INFO supervisord started with pid 10
selenium-hub  | 2025-10-30 15:28:59,049 INFO spawned: 'selenium-grid-hub' with pid 11
selenium-hub  | Starting Selenium Grid Hub...
selenium-hub  | Appending Selenium option: --port 4444
selenium-hub  | 2025-10-30 15:28:59,053 INFO success: selenium-grid-hub entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium-hub  | Appending Selenium option: --log-level INFO
selenium-hub  | Appending Selenium option: --http-logs false
selenium-hub  | Appending Selenium option: --structured-logs false
selenium-hub  | Appending Selenium option: --reject-unsupported-caps false
selenium-hub  | Appending Selenium option: --session-request-timeout 300
selenium-hub  | Appending Selenium option: --session-retry-interval 15
selenium-hub  | Appending Selenium option: --healthcheck-interval 120
selenium-hub  | Appending Selenium option: --relax-checks true
selenium-hub  | Appending Selenium option: --bind-host false
selenium-hub  | Appending Selenium option: --config /opt/selenium/config.toml
selenium-hub  | Appending Selenium option: --tracing false
selenium-hub  | Tracing is disabled
selenium-hub  | Using JAVA_OPTS:  -Dwebdriver.remote.enableTracing=false -Dwebdriver.httpclient.version=HTTP_1_1
selenium-hub  | 15:28:59.528 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
selenium-hub  | 15:28:59.533 INFO [LoggingOptions.getTracer] - Using null tracer
selenium-hub  | 15:28:59.568 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://172.18.0.2:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://172.18.0.2:4443]
selenium-hub  | 15:28:59.584 INFO [ZmqUtils.configureHeartbeat] - ZMQ XPUB socket heartbeat configured: interval=60s, timeout=180s, ttl=360s
selenium-hub  | 15:28:59.595 INFO [ZmqUtils.configureHeartbeat] - ZMQ XSUB socket heartbeat configured: interval=60s, timeout=180s, ttl=360s
selenium-hub  | 15:28:59.615 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://172.18.0.2:4442 and tcp://172.18.0.2:4443
selenium-hub  | 15:28:59.628 INFO [ZmqUtils.configureHeartbeat] - ZMQ SUB socket heartbeat configured: interval=60s, timeout=180s, ttl=360s
selenium-hub  | 15:28:59.632 INFO [ZmqUtils.configureHeartbeat] - ZMQ PUB socket heartbeat configured: interval=60s, timeout=180s, ttl=360s
selenium-hub  | 15:28:59.634 INFO [UnboundZmqEventBus.<init>] - Sockets created
selenium-hub  | 15:29:00.636 INFO [UnboundZmqEventBus.<init>] - Event bus ready
firefox-1     | Virtual environment detected at /opt/venv, activating...
firefox-1     | Python 3.12.3
chrome-1      | Virtual environment detected at /opt/venv, activating...
chrome-1      | Python 3.12.3
firefox-1     | 2025-10-30 15:29:00,983 INFO Included extra file "/etc/supervisor/conf.d/firefox-cleanup.conf" during parsing
firefox-1     | 2025-10-30 15:29:00,983 INFO Included extra file "/etc/supervisor/conf.d/recorder.conf" during parsing
firefox-1     | 2025-10-30 15:29:00,983 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
firefox-1     | 2025-10-30 15:29:00,983 INFO Included extra file "/etc/supervisor/conf.d/uploader.conf" during parsing
firefox-1     | 2025-10-30 15:29:00,986 INFO RPC interface 'supervisor' initialized
firefox-1     | 2025-10-30 15:29:00,987 INFO supervisord started with pid 9
firefox-1     | 2025-10-30 15:29:00,989 INFO spawned: 'xvfb' with pid 10
firefox-1     | 2025-10-30 15:29:00,993 INFO spawned: 'vnc' with pid 11
firefox-1     | 2025-10-30 15:29:00,996 INFO spawned: 'novnc' with pid 14
firefox-1     | 2025-10-30 15:29:01,002 INFO spawned: 'selenium-node' with pid 20
firefox-1     | 2025-10-30 15:29:01,012 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chrome-1      | 2025-10-30 15:29:01,128 INFO Included extra file "/etc/supervisor/conf.d/chrome-cleanup.conf" during parsing
chrome-1      | 2025-10-30 15:29:01,129 INFO Included extra file "/etc/supervisor/conf.d/recorder.conf" during parsing
chrome-1      | 2025-10-30 15:29:01,129 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
chrome-1      | 2025-10-30 15:29:01,129 INFO Included extra file "/etc/supervisor/conf.d/uploader.conf" during parsing
chrome-1      | 2025-10-30 15:29:01,133 INFO RPC interface 'supervisor' initialized
chrome-1      | 2025-10-30 15:29:01,134 INFO supervisord started with pid 9
chrome-1      | 2025-10-30 15:29:01,141 INFO spawned: 'xvfb' with pid 10
chrome-1      | 2025-10-30 15:29:01,142 INFO spawned: 'vnc' with pid 11
chrome-1      | 2025-10-30 15:29:01,148 INFO spawned: 'novnc' with pid 14
chrome-1      | 2025-10-30 15:29:01,151 INFO spawned: 'selenium-node' with pid 15
chrome-1      | 2025-10-30 15:29:01,165 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium-hub  | 15:29:01.311 INFO [Hub.execute] - Started Selenium Hub 4.38.0 (revision 6b412e825c): http://172.18.0.2:4444
firefox-1     | SE_EVENT_BUS_HOST not set, exiting!
firefox-1     | 2025-10-30 15:29:01,383 WARN exited: selenium-node (exit status 1; not expected)
firefox-1     | 2025-10-30 15:29:01,383 WARN received SIGINT indicating exit request
firefox-1     | 2025-10-30 15:29:01,383 INFO waiting for xvfb, vnc, novnc to die
firefox-1     | 2025-10-30 15:29:01,536 WARN stopped: novnc (terminated by SIGTERM)
chrome-1      | SE_EVENT_BUS_HOST not set, exiting!
chrome-1      | 2025-10-30 15:29:01,551 WARN exited: selenium-node (exit status 1; not expected)
chrome-1      | 2025-10-30 15:29:01,551 WARN received SIGINT indicating exit request
chrome-1      | 2025-10-30 15:29:01,551 INFO waiting for xvfb, vnc, novnc to die
chrome-1      | 2025-10-30 15:29:01,628 WARN stopped: novnc (terminated by SIGTERM)
firefox-1     | 2025-10-30 15:29:01,644 WARN stopped: vnc (terminated by SIGTERM)
firefox-1     | 2025-10-30 15:29:01,646 WARN stopped: xvfb (terminated by SIGTERM)

chrome-1      | 2025-10-30 15:29:01,664 WARN stopped: vnc (terminated by SIGTERM)


chrome-1      | 2025-10-30 15:29:01,665 WARN stopped: xvfb (terminated by SIGTERM)
firefox-1 exited with code 0
chrome-1 exited with code 0

I have to fix yamlfile

# To execute this docker-compose yml file use `docker-compose -f <file_name> up`
# Add the `-d` flag at the end for detached execution

services:
  selenium-hub:
    image: selenium/hub:latest 
    container_name: selenium-hub
    ports:
      - "4444:4444"
      
  chrome:
    image: selenium/node-chrome:latest
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      
  firefox:
    image: selenium/node-firefox:latest
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

ticket to be close

It seems an env var is missing.

I am curious about where the first compose file came from? From an older blog post or an generative AI response?

It is always a good idea to check the image description on Docker Hub, as the description usually has examples on how to use it, or links to doc pages that do.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.