Concept
Containers
Packages that hold an application and everything it needs, so it runs the same way anywhere.
- 1Package the application as an image and push it to Amazon ECR.
- 2An orchestrator, Amazon ECS or Amazon EKS, pulls the image and starts containers.
- 3The containers run on AWS Fargate or on EC2 instances.
Step by step
- 1Package the application as an image and push it to Amazon ECR.
- 2An orchestrator, Amazon ECS or Amazon EKS, pulls the image and starts containers.
- 3The containers run on AWS Fargate or on EC2 instances.
From image to running containers: one registry, two orchestrators, two places to run.
What it holds
- Virtual machine
- A full operating system, plus the application
- Container
- The application and its libraries. It shares the host’s operating system.
Size
- Virtual machine
- Large, often gigabytes
- Container
- Small, often megabytes
Moving it
- Virtual machine
- Harder to move between environments
- Container
- Runs the same anywhere containers are supported
On AWS
- Virtual machine
EC2
| Compare | Virtual machine | Container |
|---|---|---|
| What it holds | A full operating system, plus the application | The application and its libraries. It shares the host’s operating system. |
| Size | Large, often gigabytes | Small, often megabytes |
| Moving it | Harder to move between environments | Runs the same anywhere containers are supported |
| On AWS |
1 / 2
What it holds
- Virtual machine
- A full operating system, plus the application
- Container
- The application and its libraries. It shares the host’s operating system.
Size
- Virtual machine
- Large, often gigabytes
- Container
- Small, often megabytes
| Compare | Virtual machine | Container |
|---|---|---|
| What it holds | A full operating system, plus the application | The application and its libraries. It shares the host’s operating system. |
| Size | Large, often gigabytes | Small, often megabytes |
2 / 2
Moving it
- Virtual machine
- Harder to move between environments
- Container
- Runs the same anywhere containers are supported
On AWS
- Virtual machine
EC2
| Compare | Virtual machine | Container |
|---|---|---|
| Moving it | Harder to move between environments | Runs the same anywhere containers are supported |
| On AWS |
What it is
A container packages an application’s code together with the libraries and settings it needs. The package is called a container image, and Docker is a common tool for building one. The image runs the same way on a laptop, in testing and in production. Containers are lighter than virtual machines, because they share the operating system of the server they run on.
What it is
Running containers on AWS takes three choices. Store the images in a registry: Amazon Elastic Container Registry (Amazon ECR). Pick an orchestrator, which starts, stops and scales the containers: Amazon Elastic Container Service (Amazon ECS) or Amazon Elastic Kubernetes Service (Amazon EKS). Then pick where they run: on AWS Fargate, with no servers to manage, or on Amazon EC2 instances.
Containers suit applications built from many small services, called microservices, and teams that release new versions often.
Remember
- Image: the package. Container: a running copy of an image.
- Amazon ECR stores the images.
- Amazon ECS is AWS’s own orchestrator. Amazon EKS runs Kubernetes.
- Both orchestrators can run containers on Fargate or on EC2 instances.
- On EC2, you can manage the instances yourself or let AWS manage them.
On the exam
- “Package an application with its dependencies so it runs the same in every environment” describes containers.
- If a question names Kubernetes, the answer is Amazon EKS. Other container questions usually point to Amazon ECS, with AWS Fargate when no servers should be managed.