Reputation: 51
I have a single Cluster running on ECS. At the moment, I have a single task definition and a single docker container running in the cluster. 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. 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?
Upvotes: 5
Views: 4995
Reputation: 186
"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."
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).
Each service could be running any number of tasks (instances of the task definition).
Upvotes: 1