docker - Set docker toolbox container to receive information sended to host
问题描述
I have a prototype that sends information to the host machine, and with Docker for Windows, the container grabs that information and everything works fine.
My docker-compose.yml file:
version: '3'
services:
middleware:
container_name: middleware
image: hyperloopupv:middleware
build: './receta'
ports:
- "5672:5672"
- "15672:15672"
- "1338:1338/udp"
- "5556:5556/udp"
But others from my team are using Docker Toolbox, and Docker Toolbox can not use localhost. I have tried to send the information from the prototype to the IP of the container(192.168.99.100), but the packets are lost.
Is there a way, that my team(using Docker Toolbox) and I(using Docker for Windows) can get this running without problems with the same compose file?
Thanks
解决方案
Docker Desktop 和 Toolbox 是完全不同的产品。Docker Desktop 在 Hyper-V 上运行,Docker Toolbox 在 Virtualbox 上运行。Desktop 是实际产品,Toolbox 是“遗留桌面解决方案”。
可以操纵其 IP 地址。如果您查看“选项”下的文档,您会发现一个名为 virtualbox-hostonly-cidr 的选项,您可以在创建新机器时使用它来操作 IP 地址。但在您尝试此操作之前,请注意它被称为“hostonly”。这意味着它使用 Virtualbox Host-Only 适配器,并且“虚拟机无法与主机外部的世界通信,因为它们没有连接到物理网络接口”(来自 Virtualbox 文档)。
所以不幸的是,您的问题似乎没有简单的解决方案。
推荐阅读
- javascript - 当在 then 内部使用 setTimeout 时,Promises 将什么值传递给 then,为什么它会增加?
- python - 当其他命令正在运行时,Discord bot 不接受命令
- python - 为什么我的程序没有打印出 Project Euler 17 的正确答案?
- python - Python - 有没有办法将多个值附加到一个键?
- pine-script - Tradingview - 将脚本从 Pine v2 转换为 v4 时获得不同的图表
- python - 为什么 Python 不能在不转换的情况下同时打印整数和字符串?
- swift - 在 Mac、Swift、Xcode 上使用 UIDatePicker 时出错和崩溃
- r - 当使用 case_when(R 向量化)存在大量类别/类型时,R 应用多个函数
- dictionary - 将映射值复制到指针结构
- unix - 通过 Unix 中的先前实现进行连接