Containers package apps with dependencies. Amazon ECS (Elastic Container Service) runs Docker containers on AWS—on EC2 you manage, or on Fargate serverless tasks.
ECS vocabulary
- Cluster — logical grouping of capacity
- Task definition — CPU, memory, container image, env vars
- Service — maintains desired task count behind a load balancer
- ECR — private Docker registry in AWS
ECS vs EKS preview
EKS is managed Kubernetes—choose when you need K8s APIs and ecosystem. ECS is simpler when you want AWS-native orchestration without Kubernetes complexity.
List clusters
aws ecs list-clusters
aws ecr describe-repositories --query 'repositories[].repositoryName'Practice: Launch resources in the EC2 Console or CLI only in a sandbox account. Use t2.micro or t3.micro where free tier applies; terminate when done.
Important interview questions and answers
- Q: Task vs service?
A: Task is one running container group; service keeps N tasks running and replaces failures. - Q: What is ECR?
A: Elastic Container Registry—stores Docker images for ECS/EKS deployment.
Self-check
- Name two ECS components and their roles.
- When might you pick Fargate over EC2-backed ECS?
Tip: ECR image scanning catches known CVEs before deploy—enable in sandbox repos.
Interview prep
- Task vs service?
Task runs containers once; service maintains desired running task count.
- ECR?
Private Docker registry storing images for ECS/EKS deployment.