有没有一种简单的方法可以从主机访问 VM 中的 wolkenkit 应用程序 运行?

Is there an easy way to access a wolkenkit application running within a VM from the host machine?

我在 VM 中尝试 运行 wolkenkit 并从主机访问它。所以我不能使用默认值 local.wolkenkit.io(因为它指向 127.0.0.1)。我可以通过 network-ip: 10.0.1.100 访问 VM,因此 VM 和主机之间的通信应该没问题。

我试图在聊天示例 as described in the documentation 的 package.json 中更改主机。但不幸的是我只得到错误:

"Application and Docker server do not resolve to the same IP address."

似乎检查失败了,因为域 local.wolkenkit.io 解析为 127.0.0.1,这与我的网络 IP:10.0.1.100 冲突。

有解决这个问题的简单方法吗?

最简单的方法是调整 /etc/hosts 文件,使 local.wolkenkit.io(或您要使用的任何域)指向虚拟机的 IP。

(我希望我没有遗漏任何东西,但基本上你只需要确保每个人(Docker、CLI、你的外部客户端……)都解析到相同的 IP 地址使用您要使用的域名。)

希望这对您有所帮助:-)