docker/compose中links/external_links的区别
参考:
http://blog.csdn.net/halcyonbaby/article/details/47904085
http://stackoverflow.com/questions/35154441/docker-compose-links-vs-external-links
将两个服务链接 起来,使之可以通信。方法是设置/etc/hosts的域名解析。
external_links
与外部创建(可以是之前调用compose通过其他yml创建的,也可以是手工创建的容器)的容器link起来,使之可以通信。
If you want to link a container inside of the docker-compose.yml to another container that was not included in the same docker-compose.yml or started in a different manner then you can use external_links and you would set the link to the container's name.
本文详细解释了Docker Compose中links与external_links的区别。links用于定义Compose文件内部的服务间链接,而external_links则用于链接Compose外部创建的容器,实现不同配置文件或手动创建容器间的通信。

1731

被折叠的 条评论
为什么被折叠?



