构建自己的SeleniumHQ / docker-selenium的Docker映像

Yev*_*gen 6 selenium docker docker-compose

我不确定这是一个错误还是只是我很愚蠢,但事实就是如此。

我想基于StandaloneChromeDebug构建映像。跟随维基

  1. 拉回购。

  2. 生成图像:

$ make standalone_chrome_debug
Run Code Online (Sandbox Code Playgroud)
  1. 构建Dockerfile以确保不会出现错误:
$ docker build --no-cache etc/docker-selenium/StandaloneChromeDebug/
Run Code Online (Sandbox Code Playgroud)
  1. 将我的映像设置为docker-compose.yml,如下所示:
selenium-hub:
        container_name: selenium-hub
        build: ./etc/docker-selenium/StandaloneChromeDebug/
        volumes:
            - /dev/shm:/dev/shm
        ports:
            - "4444:4444"
            - "5900:5900"
        environment:
           - HUB_HOST=selenium-hub
           - HUB_PORT=4444
Run Code Online (Sandbox Code Playgroud)

没事了。容器正在运行(没有错误),但Selenium不起作用,容器日志为空,/opt/文件夹为空。我究竟做错了什么?如何调试东西?

Ser*_*ers 3

路径错误,使用build: /etc/docker-selenium/StandaloneChromeDebug/without.
如果您尝试 cd 到./etc/docker-selenium/StandaloneChromeDebug/,您将收到错误。

version: "3.5"
services:
   selenium-hub:
        container_name: selenium-hub
        build: /etc/docker-selenium/StandaloneChromeDebug/
        volumes:
            - /dev/shm:/dev/shm
        ports:
            - "4444:4444"
            - "5900:5900"
        environment:
           - HUB_HOST=selenium-hub
           - HUB_PORT=4444
Run Code Online (Sandbox Code Playgroud)

示例: 在此输入图像描述