无法从浏览器访问 docker 容器
Unable to access docker container from browser
我为开源协作工具 Mattermost 编写了一个 ChatOps 机器人,使用 this framework. Now I want to write some integration tests and run them. When I follow the steps 到 运行 他们项目的集成测试,他们不会成功。我使用命令 pytest --capture=no --log-cli-level=DEBUG .
来 运行 集成测试。
它失败了,因为 localhost:8065
在 运行 命令 docker-compose up -d
之后还不可用。有人知道我做错了什么吗?
你在 Linux、Mac 还是 Windows?我认为 network_mode: host
only works on Linux.
尝试编辑 docker-compose.yml
文件,删除网络模式“主机”和 add a port mapping,如下所示:
version: "3.7"
services:
app:
container_name: "mattermost-bot-test"
build: .
command: ./mm/docker-entry.sh
ports:
- "8065:8065"
extra_hosts:
- "dockerhost:127.0.0.1"
我为开源协作工具 Mattermost 编写了一个 ChatOps 机器人,使用 this framework. Now I want to write some integration tests and run them. When I follow the steps 到 运行 他们项目的集成测试,他们不会成功。我使用命令 pytest --capture=no --log-cli-level=DEBUG .
来 运行 集成测试。
它失败了,因为 localhost:8065
在 运行 命令 docker-compose up -d
之后还不可用。有人知道我做错了什么吗?
你在 Linux、Mac 还是 Windows?我认为 network_mode: host
only works on Linux.
尝试编辑 docker-compose.yml
文件,删除网络模式“主机”和 add a port mapping,如下所示:
version: "3.7"
services:
app:
container_name: "mattermost-bot-test"
build: .
command: ./mm/docker-entry.sh
ports:
- "8065:8065"
extra_hosts:
- "dockerhost:127.0.0.1"