π₯οΈ Day 038 of 100DaysOfCloud Deploying a Containerized App Using Amazon ECR & ECS (Fargate)
Hey Cloud Learners & DevOps Builders π
π₯οΈ Day 038 of 100DaysOfCloud Deploying a Containerized App Using Amazon ECR & ECS (Fargate)
Hey Cloud Learners & DevOps Builders π

Welcome back to the #100DaysOfCloud challenge! In todayβs task, the Nautilus DevOps team is moving deeper into container orchestration on AWS by deploying a containerized application using Amazon ECR and Amazon ECS with Fargate.
This task covers the complete container lifecycle:
π Build Docker image π Store it securely in ECR π Run it using ECS (serverless containers)
This is exactly how modern cloud-native applications are deployed π₯
π‘ Why ECR + ECS (Fargate)?
Instead of managing servers manually:
- ECR stores container images securely
- ECS runs containers at scale
- Fargate removes the need to manage EC2 instances
With Fargate: β No servers to provision β Automatic scaling β Pay only for what you run β Production-ready container orchestration
π ECR + ECS + Fargate = true serverless containers
π― Task Objectives
Container Registry
- Create a private ECR repository
devops-ecr
Image Build & Push
- Dockerfile location:
/root/pyapp- Image tag:
latest
ECS Setup
- ECS Cluster:
devops-cluster- Launch type β Fargate
Task & Service
- Task definition:
devops-taskdefinition- Service:
devops-service- Ensure at least 1 running task
π§ Step-by-Step Guide
π¦ Step 1: Create Private ECR Repository
On the aws-client host, run:
aws ecr create-repository --repository-name devops-ecr
Note the repository URI, example:
123456789012.dkr.ecr.us-east-1.amazonaws.com/devops-ecr
π Step 2: Authenticate Docker to ECR
Login to ECR:
aws ecr get-login-password \
| docker login --username AWS --password-stdin \
<ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com

Replace <ACCOUNT_ID> with your AWS account ID.
ποΈ Step 3: Build Docker Image
Navigate to Dockerfile directory:
cd /root/pyapp
Build the image:
docker build -t devops-ecr:latest .
π·οΈ Step 4: Tag Docker Image
Tag the image for ECR:
docker tag devops-ecr:latest \
<ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/devops-ecr:latest

π Step 5: Push Image to ECR
docker push <ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/devops-ecr:latest

π Image successfully pushed to ECR!
π§ͺ Verify Image Upload
aws ecr list-images --repository-name devops-ecr
You should see:
latest
βοΈ Step 6: Create ECS Cluster (Fargate)
Go to AWS Console β ECS β Clusters β Create cluster
- Cluster name:
devops-cluster- Infrastructure β AWS Fargate

Create cluster β
π Step 7: Create ECS Task Definition
Go to ECS β Task Definitions β Create
Configure:
- Launch type β Fargate
- Task definition name:
devops-taskdefinition
Container settings:
- Image:
<ECR-IMAGE-URI>:latest- CPU β 256
- Memory β 512
- Port mappings β (if app exposes a port)

Create task definition β
π§© Step 8: Create ECS Service
Go to ECS β Clusters β devops-cluster β Create service
Set:
- Launch type β Fargate
- Task definition β
devops-taskdefinition - Service name:
devops-service- Desired tasks β 1

Create service β
π’ Step 9: Verify Running Task
Go to:
ECS β devops-cluster β Tasks
You should see:
β Task status β RUNNING β Service stable

π Containerized app is now running on ECS!
π Key Takeaways
- ECR stores private Docker images securely
- ECS runs containers at scale
- Fargate removes server management
- Task definitions define what to run
- Services ensure how many to run
This is production-grade container orchestration πͺ
π« Common Mistakes to Avoid
β Forgetting to login to ECR β Using wrong image URI β Insufficient CPU/memory values β Not creating a service (task stops) β Mixing EC2 and Fargate launch types
π Conclusion + Call to Action
This was a huge milestone in your cloud journey π
You didnβt just run a containerβ¦
π you built it π stored it securely π orchestrated it π deployed it serverlessly
Thatβs real-world DevOps with containers π₯
If this guide helped you:
π Connect with me on LinkedIn π https://www.linkedin.com/in/hritik-raj-8804hr/
β Star my #100DaysOfCloud GitHub repo π https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud
See you on the next day of #100DaysOfCloud βοΈπ
λ©νλ°μ΄ν°
- post_id
- 818a1bf1fa9c
- slug
- οΈ-day-038-of-100daysofcloud-deploying-a-containerized-app-using-amazon-ecr-ecs-fargate-818a1bf1fa9c
- url
- https://medium.com/@hritikraj8804/%EF%B8%8F-day-038-of-100daysofcloud-deploying-a-containerized-app-using-amazon-ecr-ecs-fargate-818a1bf1fa9c
- canonical_url
- https://medium.com/@hritikraj8804/%EF%B8%8F-day-038-of-100daysofcloud-deploying-a-containerized-app-using-amazon-ecr-ecs-fargate-818a1bf1fa9c
- author_url
- https://medium.com/@hritikraj8804
- status
- ok
- fetched_at
- 2026-07-08 14:26:45