1.首先通过以下命令查看Gateway docker inspect bridge 假如说Gateway=172.17.0.1,要访问宿主机的3306端口,那么容器就可以通过172.17.0.1:3306来访问。