与Docker Swarm和Docker Stack相比,Docker Compose有什么好处? [英] What benefits does Docker Compose have over Docker Swarm and Docker Stack?

查看:269
本文介绍了与Docker Swarm和Docker Stack相比,Docker Compose有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我看,似乎Docker-Compose是一个可在单个主机上创建多个容器的工具,而Docker Swarm是一个可以执行相同操作但具有更多控制权的工具,并且可以在Docker的帮助下在多个主机上堆.我遍历了本教程,也遇到了这个线程:

From what I read it seems that Docker-Compose is a tool to create multiple containers on a single host while Docker Swarm is a tool that can do the exact same thing but with more control and on multiple hosts with the help of Docker Stack. I went through the tutorial and also came across this thread:

docker-compose.yml与docker-stack.yml有什么区别?

我得出的结论是,当您可以将Docker Swarm与Docker Stack一起使用时,就没有理由使用Docker-Compose.他们甚至可以使用相同的docker-compose.yml.

And I'm coming to the conclusion that there's no reason to ever use Docker-Compose when you can use Docker Swarm with Docker Stack. They can even use the same docker-compose.yml.

似乎Docker-compose在swarm和stack之前出现了,也许swarm + stack的新解决方案使compose过时了,但是由于遗留原因,它仍然存在.这种想法正确吗?如果没有,那么在创建开发或生产环境方面,Docker-Compose与Docker Swarm和Docker Stack相比有什么好处?

It seems that Docker-compose came before the swarm and stack and maybe the new solution of swarm + stack makes compose obsolete, but it still remains for legacy reasons. Is this thinking correct? If not, what benefits does Docker-Compose have over Docker Swarm and Docker Stack in terms of making a development or production environment?

推荐答案

似乎Docker-compose在swarm和stack之前出现了,也许swarm + stack的新解决方案使compose过时了,但是由于遗留原因,它仍然存在.这种想法正确吗?

It seems that Docker-compose came before the swarm and stack and maybe the new solution of swarm + stack makes compose obsolete, but it still remains for legacy reasons. Is this thinking correct?

简而言之,是的. Compose早于所有Swarm东西(它起源于名为fig的第三方工具).更糟糕的是,甚至有两种不同的Swarms,即旧的Swarm(一个是单独的工具)和Swarm Mode(这是现在docker二进制文件中内置的).

In short, yes. Compose came before all the Swarm stuff (it originated as a 3rd party utility called fig). To make matters worse, there are even two different Swarms, old Swarm (the one that was a separate tool) and Swarm Mode (which is built into the docker binary these days).

它似乎正在演变为Docker内置的服务和部署概念.但是我猜想Docker Compose和Swarm Mode部署的东西会并存一段时间.

It seems to be evolving into services and deployment concepts that get built into Docker. But I would guess Docker Compose and the Swarm Mode deployment stuff will live side by side for a while.

知道Docker Compose基础作为名为libcompose( https://github的库)的生活也是有益的.com/docker/libcompose ),其他第三方实用程序会利用它来支持docker-compose.yml文件格式进行部署(请参阅Rancher和rancher-compose作为示例).我想他们会努力继续支持libcompose.

It is also beneficial to know that Docker Compose underpinnings live as a library called libcompose (https://github.com/docker/libcompose) which other 3rd party utilities make use of to support the docker-compose.yml file format for deploying (see Rancher and rancher-compose as an example). I would imagine they would make an effort to continue support for libcompose.

我不清楚Docker Swarm部署内容是否实际使用libcompose.在我的粗略搜索中,Swarm Mode似乎实现了libcompose并完成了自己的工作.我不确定这与Docker Compose和libcompose的未来有何关系.按您认为合适的方式进行解释...

I am unclear if the Docker Swarm deployment stuff actually uses libcompose. In my cursory searches, it would appear that Swarm Mode does not implement libcompose and does its own thing. I am not sure how this relates to the future of Docker Compose and libcompose. Interpret as you see fit...

这篇关于与Docker Swarm和Docker Stack相比,Docker Compose有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆