Multiple docker containers in one EC2 instance through AWS ECS

Yes, for doing that write the task definition that have definition of multiple container.


Exactly. That's possible.

Write one task definition per docker image and run that through a service to automate the deployment. You also need to be careful while dividing the memory and CPU among different tasks to run different docker.

Here is the link for reference.


Yes.

AWS's documentation/product details doesn't ever come out and say it explictly, but it talks about launching many containers to a cluster. A cluster can be one instance.

When configuring a container, you specify memory and CPU usage. ECS uses that to "schedule" (or "pack") an EC2 with Docker containers.


All containers defined in one ecs task are deployed onto the same instance.

Even if the cluster has many instances all containers defined in one task are located on the same ec2 instance. The containers can access each other using the links defined between them.

This is equivalent to a POD in Kubernetes.