gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:46:21 27 4
gpt4 key购买 nike

我有以下 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

关于selenium - 从 docker-compose.yml 运行 Zalenium 时自动拉取依赖镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54220118/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com