Want to store and manage **Docker images** using **AWS Elastic Container Registry (ECR)**? π In this tutorial, I’ll guide you through **pushing, pulling, and running Docker images** with AWS ECR, step by step. By the end of this video, you’ll know how to: β
**Create an AWS ECR repository** β
**Push Docker images** to AWS ECR β
**Pull images** from AWS ECR β
**Run Docker containers** from an AWS ECR image — ## **πΉ What You’ll Learn in This Video:** βοΈ How to **set up AWS ECR** βοΈ How to **authenticate Docker with AWS ECR** βοΈ How to **push and pull Docker images** βοΈ How to run a **container from an AWS ECR image** — ## **πΉ Prerequisites** βοΈ **AWS CLI Installed** ([Download AWS CLI](https://aws.amazon.com/cli/)) βοΈ **Docker Installed** ([Download Docker](https://www.docker.com/get-started)) βοΈ An **AWS Account** ([Sign Up](https://aws.amazon.com/)) βοΈ Basic knowledge of **Docker commands** — ## **πΉ Step 1: Create an AWS ECR Repository** 1οΈβ£ **Login to AWS Console** → Go to **ECR (Elastic Container Registry)** 2οΈβ£ Click **Create Repository** 3οΈβ£ Choose **Public or Private** repository 4οΈβ£ Copy the **repository URI** for later Alternatively, create a repository using the AWS CLI: “`bash
aws ecr create-repository –repository-name my-docker-app
“` — ## **πΉ Step 2: Authenticate Docker with AWS ECR** Use the AWS CLI to log in to ECR: “`bash
aws ecr get-login-password –region us-east-1 | docker login –username AWS –password-stdin [aws_account_id].dkr.ecr.us-east-1.amazonaws.com
“` πΉ Replace **us-east-1** with your AWS region. πΉ Replace **[aws_account_id]** with your actual AWS account ID. — ## **πΉ Step 3: Build and Tag a Docker Image** If you have a **Dockerfile**, build the image: “`bash
docker build -t my-docker-app .
“` Tag the image with your ECR repository URL: “`bash
docker tag my-docker-app:latest [aws_account_id].dkr.ecr.us-east-1.amazonaws.com/my-docker-app:latest
“` — ## **πΉ Step 4: Push the Docker Image to AWS ECR** Now, push the image to your AWS ECR repository: “`bash
docker push [aws_account_id].dkr.ecr.us-east-1.amazonaws.com/my-docker-app:latest
“` Once uploaded, your image will be available in AWS ECR. — ## **πΉ Step 5: Pull the Docker Image from AWS ECR** On another system or EC2 instance, **pull the image**: “`bash
docker pull [aws_account_id].dkr.ecr.us-east-1.amazonaws.com/my-docker-app:latest
“` To verify the pulled image, run: “`bash
docker images
“` — ## **πΉ Step 6: Run a Docker Container from AWS ECR Image** Run the container locally: “`bash
docker run -d -p 5000:5000 [aws_account_id].dkr.ecr.us-east-1.amazonaws.com/my-docker-app:latest
“` πΉ This command runs the container and maps port **5000** to your local machine. — ## **πΉ Common Issues & Fixes** πΉ **Denied: requested access to the resource is denied** β
**Fix:** Ensure your AWS CLI is configured with `aws configure`. πΉ **Error: authentication required** β
**Fix:** Re-run the `docker login` command to authenticate. πΉ **Image not found when pulling** β
**Fix:** Double-check the **repository name** and **region**. — ## **πΉ Who Is This Tutorial For?** β
Developers working with **AWS & Docker** β
DevOps engineers managing **container registries** β
Anyone deploying **containerized applications** — ## **πΉ More AWS & Docker Tutorials:** π **How to Deploy a Dockerized Flask App on AWS ECS** → [Watch Now] π **How to Use AWS Lambda with Docker Containers** → [Watch Now] π **How to Set Up Continuous Deployment with AWS ECR & GitHub Actions** → [Watch Now] — ## **π Like, Share & Subscribe!** If this tutorial helped you, please **LIKE, SHARE, and SUBSCRIBE** for more **AWS, Docker, and DevOps tutorials**! π π¬ Have questions? Drop them in the **comments** below! — ### **πΉ Hashtags:** #AWS #Docker #AWSCloud #ECR #ElasticContainerRegistry #DevOps #CloudComputing #Containerization #Microservices #DockerHub Now you know how to **push, pull, and run Docker images using AWS ECR** like a pro! ππ³