Multiple docker containers in one EC2 instance thr

2020-05-20 07:53发布

Is it possible to run multiple docker containers in one EC2 instance through AWS ECS (EC2 Container Service)?

4条回答
老娘就宠你
2楼-- · 2020-05-20 08:43

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.

查看更多
做个烂人
3楼-- · 2020-05-20 08:47

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

查看更多
来,给爷笑一个
4楼-- · 2020-05-20 08:48

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.

查看更多
看我几分像从前
5楼-- · 2020-05-20 08:49

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.

查看更多
登录 后发表回答