Docker:docker run和docker service之间的区别 [英] Docker: Difference between `docker run` and `docker service`

查看:163
本文介绍了Docker:docker run和docker service之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 docker 的新手,刚刚开始涉足这一领域.我在网上阅读有关此内容的信息.我知道 docker 的以下命令,它们是: docker run docker service .据我了解,通过 docker run ,我们正在旋转一个新的 container .但是我不清楚 docker service 是做什么的?它会在 Swarm 中旋转容器吗?

I am very new to docker , just started venturing into this. I read online about this. I came to know of the following commands of docker which is: docker run and docker service. As I understood , with docker run we are spinning a new container. However I am not clear what docker service do? Does it spin container in a Swarm?

任何人都可以帮助您简单地理解吗?

Can anyone help understand in simple to understand?

推荐答案

docker run 命令在本地docker主机上创建并启动容器.

The docker run command creates and starts a container on the local docker host.

泊坞窗服务"是在泊坞窗的群集模式下运行的具有相同配置的一个或多个容器.它与 docker run 类似,因为您旋转了一个容器.区别在于您现在具有业务流程.如果编排停止,该业务流程将重新启动容器,根据您的约束找到合适的节点来运行该容器,扩大或缩小您的服务,允许您使用网状网络和VIP来发现您的服务,并执行滚动更新以更改正在运行的应用程序期间发生中断的风险降到最低.

A docker "service" is one or more containers with the same configuration running under docker's swarm mode. It's similar to docker run in that you spin up a container. The difference is that you now have orchestration. That orchestration restarts your container if it stops, finds the appropriate node to run the container on based on your constraints, scale your service up or down, allows you to use the mesh networking and a VIP to discover your service, and perform rolling updates to minimize the risk of an outage during a change to your running application.

这篇关于Docker:docker run和docker service之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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