Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium 从docker-compose.yml运行Zalenium时自动拉取依赖映像_Selenium_Docker_Docker Compose_Zalenium - Fatal编程技术网

Selenium 从docker-compose.yml运行Zalenium时自动拉取依赖映像

Selenium 从docker-compose.yml运行Zalenium时自动拉取依赖映像,selenium,docker,docker-compose,zalenium,Selenium,Docker,Docker Compose,Zalenium,我有以下docker-compose.yml文件。当我运行此命令时,会收到消息“请运行'docker pull elgalu/selenium',或通过--seleniumImageName使用您自己的兼容映像”。如果我拉图像,我的测试运行良好。如何在运行撰写文件时自动提取图像,而不是手动提取图像。谢谢你的帮助 version: '3' services: zalenium: image: repo.forge.lmig.com/docker/dosel/zalenium

我有以下docker-compose.yml文件。当我运行此命令时,会收到消息“请运行'docker pull elgalu/selenium',或通过--seleniumImageName使用您自己的兼容映像”。如果我拉图像,我的测试运行良好。如何在运行撰写文件时自动提取图像,而不是手动提取图像。谢谢你的帮助

version: '3'

services:

  zalenium:
    image: repo.forge.lmig.com/docker/dosel/zalenium
    container_name: zalenium
    depends_on:
       - selenium
    ports:
      - "4444:4444"
    restart: unless-stopped
    tty: true
    command: ["start", "--desiredContainers", "5", "--maxDockerSeleniumContainers", "10","--sauceLabsEnabled","false","--screenWidth", "1920", "--screenHeight", "1080"]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /Users/goutham/git/selenium-tests/test-output/videos:/home/seluser/videos
    privileged: true   
    networks:
      mynetwork:
        aliases:
          - chrome


 selenium-tests: 
    image: selenium-tests:latest
    container_name: selenium-tests-container      
    depends_on:
      - zalenium
    networks:
      mynetwork:  
    volumes:
     - /Users/goutham/git/selenium-tests/test-output:/test-output

networks:
  mynetwork:
    driver: bridge
添加新服务

  dep:
    image: elgalu/selenium
    command: echo 0
    restart: "no" # ensures it does not get recreated
将此添加到Zalenium中

  depends_on:
       - selenium
       - dep # ensures pull/launch order

如果指定环境变量,则可以自动提取图像

PULL_SELENIUM_IMAGE=true