Multiple docker containers in one EC2 instance through AWS ECS

ε祈祈猫儿з 提交于 2020-04-07 13:52:24

问题


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


回答1:


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.




回答2:


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




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/33966108/multiple-docker-containers-in-one-ec2-instance-through-aws-ecs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!