Windows环境下运行Selenium Grid 4(Dynamic Grid)Docker Compose时遭遇OCI Runtime错误求助
Let’s walk through resolving your errors step by step—this is a common set of issues when setting up Dynamic Grid on Windows, so we’ll get you up and running like the video example in no time.
1. Fix the Config File Mount Path
The core error you’re seeing is because Docker is trying to mount a file from a non-existent NodeDocker directory. You mentioned your config.toml is directly in your Documents folder (same as docker-compose.yml), but your compose file is looking for it inside a NodeDocker subfolder.
Update your docker-compose.yml to correct the volume path for config.toml:
version: "3" services: node-docker: image: selenium/node-docker:4.1.2-20220208 volumes: - ./assets:/opt/selenium/assets # We'll handle this next - ./config.toml:/opt/bin/config.toml # Changed from ./NodeDocker/config.toml depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: image: selenium/hub:4.1.2-20220208 container_name: selenium-hub ports: - "4442:4442" - "4443:4443" - "4444:4444"
2. Correct the Docker Daemon URL in config.toml
On Windows, 127.0.0.1 inside a Docker container refers to the container itself, not your host machine. You need to use Docker’s special hostname for the host.
Update your config.toml with the correct URL:
[docker] configs = [ "selenium/standalone-firefox:4.1.2-20220208", "{\"browserName\": \"firefox\"}", "selenium/standalone-chrome:4.1.2-20220208", "{\"browserName\": \"chrome\"}", "selenium/standalone-edge:4.1.2-20220208", "{\"browserName\": \"MicrosoftEdge\"}" ] # Use host.docker.internal to reach your Windows host's Docker daemon url = "http://host.docker.internal:2375" video-image = "selenium/video:ffmpeg-4.3.1-20220208"
Also, make sure Docker Desktop is configured to expose the daemon:
- Open Docker Desktop Settings → General
- Check "Expose daemon on tcp://localhost:2375 without TLS"
- Click "Apply & Restart"
3. Create the Assets Directory
The assets volume in your compose file is meant to share files (like test data, downloads, or screenshots) between your host and the Selenium containers. Even if you don’t need it right now, Docker will throw an error if the directory doesn’t exist.
In your Documents folder, run this in PowerShell:
mkdir assets
4. Resolve Duplicate Docker Compose Files
You’re seeing a warning about having both docker-compose.yml and docker-compose.yaml in the same directory. To avoid confusion, either:
- Delete one of the files, or
- Specify the exact file when running commands:
docker-compose -f docker-compose.yml up
Final Steps to Run the Grid
- First, clean up any existing containers from your failed attempts:
docker-compose down - Start the grid:
docker-compose up - Verify it’s working by opening
http://localhost:4444in your browser—you should see the Selenium Grid console.
Now you should be able to run tests that dynamically spin up Chrome/Firefox/Edge containers, just like the video example.
内容的提问来源于stack exchange,提问作者user5199

