docker-compose.yml文件
version: '3'
services:
selenoid:
image: "aerokube/selenoid:latest"
container_name: selenoid
ports:
- "4444:4444"
networks:
- selenoid
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: ["-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "selenoid"]
selenoid-ui:
image: "aerokube/selenoid-ui:latest"
container_name: selenoid-ui
links:
- selenoid
ports:
- "8081:8081"
networks:
- selenoid
command: ["--selenoid-uri", "http://selenoid:4444"]
chrome_89.0:
image: "selenoid/vnc:chrome_89.0"
container_name: chrome_89.0
links:
- selenoid
- selenoid-ui
depends_on:
- selenoid
- selenoid-ui
networks:
- selenoid
volumes:
- "/dev/shm:/dev/shm"
chrome_91.0:
image: "selenoid/vnc:chrome_91.0"
container_name: chrome_91.0
links:
- selenoid
- selenoid-ui
depends_on:
- selenoid
- selenoid-ui
networks:
- selenoid
volumes:
- "/dev/shm:/dev/shm"
firefox_57.0:
image: "selenoid/vnc:firefox_57.0"
container_name: firefox_57.0
links:
- selenoid
- selenoid-ui
depends_on:
- selenoid
- selenoid-ui
networks:
- selenoid
volumes:
- "/dev/shm:/dev/shm"
firefox_83.0:
image: "selenoid/vnc:firefox_83.0"
container_name: firefox_83.0
links:
- selenoid
- selenoid-ui
depends_on:
- selenoid
- selenoid-ui
networks:
- selenoid
volumes:
- "/dev/shm:/dev/shm"
networks:
selenoid:
external:
name: selenoid
browser.json文件
{
"firefox": {
"default": "57.0",
"versions": {
"57.0": {
"image": "selenoid/vnc:firefox_57.0",
"port": "4444",
"path": "/wd/hub"
}
},
"versions": {
"83.0": {
"image": "selenoid/vnc:firefox_83.0",
"port": "4444",
"path": "/wd/hub"
}
}
},
"chrome": {
"default": "latest",
"versions": {
"89.0": {
"image": "selenoid/vnc:chrome_89.0",
"port": "4444",
"path": "/"
}
},
"versions": {
"91.0": {
"image": "selenoid/vnc:chrome_91.0",
"port": "4444",
"path": "/"
}
}
}
}
按顺序执行以下命令:
- docker network create selenoid命令
- docker compose up-d命令
- docker ps-a
所有的容器都在运行。
当我尝试为selenoid UI启动localhost:8081时,它并没有按预期工作。
我只想在8081上运行我的selenoid UI,因为8080端口被我的本地Jenkins占用了。
请让我知道我是否缺少任何配置,以及如何访问8081端口上的selenoid UI。
谢谢。
您可以更改docker compose服务中的selenoid UI端口以映射到端口8080,如:
selenoid-ui:
image: "aerokube/selenoid-ui:latest"
container_name: selenoid-ui
links:
- selenoid
ports:
- "8081:8080"
或者你只需要改变它正在监听的端口,就像在这个答案中传递参数:
-listen :8081