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. 

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐