mac系统上访问docker容器中的ip配置

使用 mac系统,发现docker没有 docker0网桥,无法直接在宿主机上 访问 容器的ip,

在测试的时候有这种需求,而不是通过-p的方式,可以参考下面的连接,主要就是

修改 setting.json,加上socket代理端口,然后配置在网络高级中配置 sockets代理即可。

具体可以参考如下链接。

https://github.com/docker/for-mac/issues/2670

For anyone else having trouble following this thread. With a recent version of Docker of Mac, add "socksProxyPort" : 8888, to ~/Library/Group Containers/group.com.docker/settings.json(be sure to respect strict json syntax); and restart Docker.

 

原文地址:https://www.cnblogs.com/huaxiaoyao/p/12088948.html