V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Latin
V2EX  ›  Docker

wsl2 docker network_mode host 求教

  •  1
     
  •   Latin · 2021-10-08 14:27:10 +08:00 · 1191 次点击
    这是一个创建于 902 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • 环境描述:

    win10 wsl2 docker

    • 问题描述

    无法使用网卡 host 模式

    • 问题进度:

    已经查阅各个渠道 github google stackoverflow 还没有透彻的解决办法

    5 条回复    2021-11-09 17:25:49 +08:00
    smallX
        1
    smallX  
       2021-10-08 14:38:25 +08:00
    怎么判断 无法使用网卡 host 模式?
    AllenHua
        2
    AllenHua  
       2021-10-08 14:43:46 +08:00   ❤️ 1
    据我所知,windows 上 docker desktop 无法使用 host network mode

    https://stackoverflow.com/questions/48915458/windows-run-docker-with-network-host-and-access-with-127-0-0-1

    > The host networking driver only works on Linux hosts, and is not supported on Docker for Mac, Docker for Windows, or Docker EE for Windows Server.

    我 2021-07-19 也踩过坑
    Latin
        3
    Latin  
    OP
       2021-10-08 15:45:21 +08:00
    @smallX 因为 hyper-v
    Latin
        4
    Latin  
    OP
       2021-10-08 15:45:47 +08:00
    @AllenHua 那就不纠结了 就这样吧 (
    brucecao
        5
    brucecao  
       2021-11-09 17:25:49 +08:00
    也弄不明白哦。本想弄个 WSL2 +docker+ clash 透明代理,感觉要崩啊,docker 用 host 模式,咋也进不了 yacd 的模板,明明已经运行很好了,win 里连不上端口。失败!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2681 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 15:46 · PVG 23:46 · LAX 08:46 · JFK 11:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.