docker容器访问宿主机ip

docker run -it --add-host=host.docker.internal:host-gateway xxx

容器访问host.docker.internal:3306等同于访问了宿主机的3306端口

posted @ 2022-04-19 12:55  Lucas_zou  阅读(1138)  评论(0)    收藏  举报