by algesten · 7y ago · 0 comments
With AWS you already have a virtualization, why do we need another layer?
We packaged a super slim Linux with an init that just has some minimal code reading out of AWS EC2 user info the conf. Downloads docker hub image and runs it as a process.
No virtual networking or ssh access. No magic. Just a process on an aws ec2 instance.
Why dedicate an entire ec2 instance to a single container?
You would scale the virtual machines to try and reach optimal resource usage rather than pick a standard fleet of virtual machines for all workloads and let a scheduler do some kind of knapsack scheduling based on available resources.
Meanwhile containers enable you to run multiple services on the same VM, scale them horizontally as you need on the same pre-determined amount of resources, use blue/green deployments to spread your services throughout your VMs automatically, and achieve all of this automatically and effortlessly.
The argument though is that can't run an EC2 (AMI) anywhere except AWS.
The advantage of Virtual box images or Docker/OCI images is that you can run them in multiple places (locally, AWS, GCP, Raspberry Pi, etc.) with consistent results.
So if you have 10 services deployed on 10 ec2 instances each, you will need 200 ec2 instances to give yourself 50% headroom for each service.
With containers, you can give each container 10x headroom for the same amount of hardware.