【问题标题】:what should be used instead of 'host.docker.internal' when using nerdctl in place of docker?使用 nerdctl 代替 docker 时应该使用什么来代替“host.docker.internal”?
【发布时间】:2022-01-14 11:48:41
【问题描述】:

使用 docker 桌面时,我们将使用 URL 'host.docker.internal' 从容器连接到主机。

但是,当我使用 nerdctl 而不是 docker 时,容器无法连接到主机(即我的机器)。

我安装 Rancher 桌面使用 nerdctl

【问题讨论】:

    标签: docker localhost containerd nerdctl


    【解决方案1】:

    来自 lima 文档。

    主机的环回地址为192.168.5.2,可访问 从来宾作为 host.lima.internal。

    所以不是host.docker.internal,而是提供192.168.5.2

    我已经用通过 Rancher 分发的 nerdctl 对此进行了测试,它可以工作!

    参考:https://github.com/lima-vm/lima/blob/master/docs/network.md

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-05
      • 2010-12-06
      • 2012-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多