近期在使用 M1 的 docker 过程中发现容器内的程序无法访问宿主机的 ip+端口,比如容器内要访问宿主机的 mysql 服务使用 host.docker.internal 就不行,不知有没有大佬们遇到并解决的
1
drinkeroftea Mar 5, 2021
macOS 版 docker 可以用 docker.for.mac.host.internal, 并让 mysql 监听 0.0.0.0
|
2
xingcy OP @drinkeroftea 在 Intel 内没问题,M1 里面不行,所以我上面描述的是 M1 的 docker
|
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. |