简体   繁体   English

一个 ECS 集群中的多个容器

[英]Multiple containers in one ECS cluster

I have a single Cluster running on ECS.我有一个在 ECS 上运行的集群。 At the moment, I have a single task definition and a single docker container running in the cluster.目前,我有一个任务定义和一个在集群中运行的 docker 容器。 I would like to deploy a second container to the same cluster that will be running entirely separately.我想将第二个容器部署到将完全单独运行的同一个集群。 What is the best way to achieve this?实现这一目标的最佳方法是什么?

I have tried setting up a second task definition pointing to the second image in ECR, and then setting up a second service for that definition.我已经尝试设置指向 ECR 中第二个图像的第二个任务定义,然后为该定义设置第二个服务。 I'm not sure if this is the best approach.我不确定这是否是最好的方法。

Are there any good examples online of how to achieve the running of two separate containers in a single ECS cluster?网上有没有很好的例子说明如何实现在单个ECS集群中运行两个独立的容器?

"I have tried setting up a second task definition pointing to the second image in ECR, and then setting up a second service for that definition. I'm not sure if this is the best approach." “我已经尝试设置第二个任务定义,指向 ECR 中的第二个图像,然后为该定义设置第二个服务。我不确定这是否是最好的方法。”

Yes this is a correct way to do it, so I don't think you need any examples.是的,这是一种正确的方法,所以我认为您不需要任何示例。

Each service uses a task definition that refers to a container in ECR (or other repo, like Docker Hub, but typically ECR).每个服务都使用一个任务定义,该定义引用 ECR 中的容器(或其他存储库,如 Docker Hub,但通常是 ECR)。

Each service could be running any number of tasks (instances of the task definition).每个服务都可以运行任意数量的任务(任务定义的实例)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM