← Back to list

πŸŒ₯️ Day 038 of 100DaysOfCloud Deploying a Containerized App Using Amazon ECR & ECS (Fargate)

Hey Cloud Learners & DevOps Builders πŸ‘‹

Hritik Raj Β· 2026-01-18 05:59 Β· 0 claps Β· 3.6 min read
#aws-ecs-fargate #aws-ecr #devops #100daysofcloud #kodekloudengineer
Open on Medium β†—
Wiki topics: ☁️ · DevOps & Cloud

πŸŒ₯️ 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