Amazon ECS & ECR — Container Workflow Explained

Amazon ECS & ECR — Container Workflow Explained

ECR stores your Docker image securely. ECS runs it. The ALB distributes traffic. Here's the full workflow, step by step.

🐳 Amazon ECS & ECR — Container Workflow Explained
Confused about ECS and ECR? Here's the simple flow:
ECR is where your Docker image lives. ECS is where that image runs as a container.
The workflow
  1. Build your Docker image — FROM nginx Package your application into a Docker container image, here netflix-nginx.
  1. Push it to Amazon ECR Amazon ECR (Elastic Container Registry) is a secure, fully-managed container registry. It stores the netflix-nginx image with versioning, encryption and access control.
  1. Amazon ECS pulls it and runs it Amazon ECS (Elastic Container Service) orchestrates and runs containers as a managed service. A task definition defines how the container runs — CPU, memory, network — and the ECS cluster runs it, using image netflix-nginx:latest.
  1. The ECS Service keeps your tasks running ECS launches and manages tasks on AWS Fargate (serverless, no servers to manage) or Amazon EC2 (instances you manage). The service maintains your desired count of tasks running.
  1. The Application Load Balancer routes traffic The ALB routes traffic to healthy tasks — Netflix Task 1 and Netflix Task 2 — so external users reach the app through the ALB DNS, load-balanced across tasks.
How it all fits
ECR stores your container image securely → ECS pulls the image from ECR and runs it in a task → ALB distributes traffic to tasks for high availability.
Key benefits
  • Scalable — auto-scale tasks based on demand
  • Reliable — health checks and auto-replacement
  • Secure — IAM roles, VPC and private networking
That's how the same Netflix landing page runs in production.
About the author
Darshan Patil — DevOps | AWS Cloud | Terraform | Docker | Jenkins GitHub: github.com/darshanpatil8799 LinkedIn: linkedin.com/in/darshan-devops Builder Center: builder.aws.com/profile — @darshpatil
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article