国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

docker無法通過宿主ip訪問容器中的mysql
過去多啦不再A夢
過去多啦不再A夢 2017-04-25 09:01:33
0
7
1784

如圖

這里設(shè)置的應(yīng)該是,將容器的3306映射到主機的3366上,但是我只能通過192.168.99.100:3366來連接容器內(nèi)的mysql服務(wù)

我宿主機的真實ip是10.0.0.2

但是我通過10.0.0.2:3366卻連接不上,求大神指點一下

過去多啦不再A夢
過去多啦不再A夢

reply all(7)
習(xí)慣沉默

To answer your question directly:
The reason why you have to go through a 192.168.99.100:3366來訪問容器而不是宿主機的IP:10.0.0.2,就在于:你用了 Toolbox, 而 Toolbox 默認(rèn)用到了 Virtualbox virtual machine is that there is an extra layer.

Picture description:

@Youming is right. It is recommended that you use Docker for Mac. ToolboxIt will be gradually abandoned.

我想大聲告訴你

Try turning off the firewall

曾經(jīng)蠟筆沒有小新

Try to see if you can connect to it in the container. By default, mysql configuration can only connect to the IP address of 127.0.0.1.

劉奇

Provide some ideas:

  • First test the service status of mysql service on each IP through port 3306, such as:

telnet 10.0.0.2 3306
telnet 192.168.99.100 3306
  • If telnet finds that the port is open, then check the setting problem of mysql, that is, whether mysql clients with other IP addresses are allowed to access

PHPzhong

To add the network segment of the docker container to the firewall, please allow access to the host

洪濤

iptables -F

我想大聲告訴你

Why are you using the Toolbox version of Docker now? If you directly use the latest version of Docker for Mac, your problem will not be a problem...

Docker actually runs in a Linux virtual machine on a Mac system. The Toolbox version of Docker uses VirtualBox as a virtual machine. Because it is a third-party application and the interface provided by the application is limited, although Docker can map ports to virtual on the machine, but the port of the virtual machine cannot be mapped to the host. To achieve this mapping, you need to manually do port mapping in VirtualBox.

The new version of Docker for Mac uses xhyve as the virtual machine provider. Due to the native support of the Mac system, it provides a richer interface. Docker for Mac can also automatically complete the port mapping between the virtual machine and the host. Therefore, in the new version of Docker for Mac, there is no need to manually map the virtual machine to the host port. You can directly use the local port 127.0.0.1 to access the container bound to it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template