Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS ECS start multiple containers in one task definition

I have docker container with one application, application runs based on input parameters, passed to entrypoint. I want to create one task definition for ECS and run multiple containers in parallel in one task definition with different input parameters for each container.

The issue is - that I cannot do it without setting essential option to one of my containers in task definition. But, I do not want stop others, if my essential container finishes. All containers are independent.

Possible option is to create one task definition per one container. But it will cost more, because my application doesn't use lot of resources.

Is there any other solution or approach to run multiple containers in one task definition not rely on essential option?

like image 408
Dipas Avatar asked Nov 04 '18 20:11

Dipas


1 Answers

In your situation when you want to run multiple containers of different application. It is recommended to use a separate task definition for each one of them.

We use multiple containers in one task definition when we wanted to run some sort of sidecar with our application which is one of the containers of that task definition.

Also, In ECS you don't pay for task definition, You pay for AWS resources (e.g. EC2 instances or EBS volumes) you create to store and run your application. You only pay for what you use, as you use it; there are no minimum fees and no upfront commitments.

Pricing: https://aws.amazon.com/ecs/pricing/

like image 74
mohit Avatar answered Oct 21 '22 09:10

mohit