-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Description
What happened?
I tried to launch a docker-selenium container on an openEuler machine. The selenium service is a part of a python project of 4 containers, including main container(called sbom), elasticsearch, mongodb and selenium. The selenium service seems to run correctly because it can be shown by command "docker ps", but when I try to invoke it by http request, an error occurs(message: connection refused) . And when I execute "docker exec selenium curl http://localhost:4444/wd/hub/status", it fails either.
Command used to start Selenium Grid with Docker (or Kubernetes)
# docker-compose.yaml
services:
elasticsearch:
image: docker.m.daocloud.io/library/elasticsearch:8.12.1
container_name: elasticsearch
environment:
- discovery.type=single-node
- network.host=0.0.0.0
ports:
- "9200:9200"
- "9300:9300"
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- sbom_network
mongodb:
image: docker.m.daocloud.io/library/mongo:4.4
container_name: mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
networks:
- sbom_network
selenium:
image: selenium/standalone-chromium:125.0
shm_size: 2gb
container_name: selenium
ports:
- 4444:4444
- 7900:7900
- 5900:5900
networks:
- sbom_network
sbom:
build:
context: .
dockerfile: dockerfile
container_name: sbom
depends_on:
- elasticsearch
- mongodb
- selenium
ports:
- "5000:5000"
networks:
- sbom_network
networks:
sbom_network:
driver: bridge
ipam:
config:
- subnet: 172.18.0.0/16
volumes:
es_data:
mongodb_data:
#usage in python project
options = Options()
options.add_argument('--headless')
driver = webdriver.Remote(command_executor='http://selenium:4444/wd/hub', options=options)
driver.get(url)
Relevant log output
#docker logs selenium
2024-10-22 05:28:35,839 INFO Included extra file "/etc/supervisor/conf.d/chrome-cleanup.conf" during parsing
2024-10-22 05:28:35,839 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2024-10-22 05:28:35,874 INFO RPC interface 'supervisor' initialized
2024-10-22 05:28:35,874 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-10-22 05:28:35,875 INFO supervisord started with pid 9
2024-10-22 05:28:36,878 INFO spawned: 'xvfb' with pid 10
2024-10-22 05:28:36,880 INFO spawned: 'vnc' with pid 11
2024-10-22 05:28:36,882 INFO spawned: 'novnc' with pid 12
2024-10-22 05:28:36,886 INFO spawned: 'selenium-standalone' with pid 13
2024-10-22 05:28:36,891 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-10-22 05:28:36,892 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-10-22 05:28:36,892 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-10-22 05:28:36,892 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-10-22 05:28:36,905 INFO exited: novnc (exit status 1; not expected)
#docker exec selenium curl http://localhost:4444/wd/hub/status
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to localhost port 4444 after 0 ms: Connection refused
Operating System
openEuler 22.03 LTS for ARM
Docker Selenium version (image tag)
125.0
Selenium Grid chart version (chart version)
No response