xingcy

M1 的 docker 容器内无法访问宿主机 ip?

  •  
  •   xingcy · Mar 5, 2021 · 4083 views
    This topic created in 1901 days ago, the information mentioned may be changed or developed.
    近期在使用 M1 的 docker 过程中发现容器内的程序无法访问宿主机的 ip+端口,比如容器内要访问宿主机的 mysql 服务使用 host.docker.internal 就不行,不知有没有大佬们遇到并解决的
    6 replies    2021-03-08 11:56:40 +08:00
    drinkeroftea
        1
    drinkeroftea  
       Mar 5, 2021
    macOS 版 docker 可以用 docker.for.mac.host.internal, 并让 mysql 监听 0.0.0.0
    xingcy
        2
    xingcy  
    OP
       Mar 5, 2021
    @drinkeroftea 在 Intel 内没问题,M1 里面不行,所以我上面描述的是 M1 的 docker
    guyeu
        3
    guyeu  
       Mar 6, 2021
    这个 bug 不是已经修掉了吗,老兄试试最新版?

    以下摘自官网:

    Fixes since the Apple Silicon preview 7
    Docker Desktop preview 3.1.0 (60984)

    2021-02-11

    Kubernetes now works (although you might need to reset the cluster in our Troubleshoot menu one time to regenerate the certificates).
    osxfs file sharing works.
    The host.docker.internal and vm.docker.internal DNS entries now resolve.
    Removed hard-coded IP addresses: Docker Desktop now dynamically discovers the IP allocated by macOS.
    The updated version includes a change that should improve disk performance.
    The Restart option in the Docker menu works.
    xingcy
        4
    xingcy  
    OP
       Mar 8, 2021
    @guyeu 没有更新提醒,看修正的日期那应该是我老版本的问题,晚点试试
    guyeu
        5
    guyeu  
       Mar 8, 2021
    @xingcy 这个版本不支持应用内更新,每次更新都需要去那个页面下载新版本。
    xingcy
        6
    xingcy  
    OP
       Mar 8, 2021
    @guyeu 哈哈,这样子啊,晚点我试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2345 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 16:10 · PVG 00:10 · LAX 09:10 · JFK 12:10
    ♥ Do have faith in what you're doing.