When Docker starts a container, it will create a default network for it -containerName_defaul,所以使用--link方式互联容器时由于默认不在一个网络中,会报上述错误,解决办法即添加--net XX_default, so that the new container and the link target are in the same network. Reference: http://stackoverflow.com/ques...
The reason for executing in a container is of course. Container isolation also includes network isolation. The host network cannot be seen or operated in the Docker container, so it is impossible to connect to other containers located on the host network.
When Docker starts a container, it will create a default network for it -
containerName_defaul
,所以使用--link
方式互联容器时由于默认不在一个网络中,会报上述错误,解决办法即添加--net XX_default
, so that the new container and the link target are in the same network.Reference: http://stackoverflow.com/ques...
The reason for executing in a container is of course. Container isolation also includes network isolation. The host network cannot be seen or operated in the Docker container, so it is impossible to connect to other containers located on the host network.