# Day 28 : Creating a Private ECR Repository

Welcome to Day 28. Today, we will learn how to create a private ECR repository. Docker files and other necessary files are already provided in the **/root/pyapp** directory. You just need to build the Docker image and push it to the AWS private ECR repository.

### What is AWS Private ECR Repository?

**Amazon ECR (Elastic Container Registry) Private** is a fully managed Docker container registry that allows you to securely store, manage, and deploy your proprietary container images.

While a **Public** registry (like Docker Hub or ECR Public) allows anyone to download your images, a **Private** registry restricts access only to specific AWS accounts, IAM users, or VPCs that you authorize.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569102530/76d352dc-bddb-47fa-9b8a-3a20a8e18a3b.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569142690/a724ddd9-e530-4624-ad96-850893a72a65.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569210619/03a93baa-dd49-4d12-aa81-a652743cf825.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569230230/98c8b6c6-9762-4808-8519-1934a3bad009.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569286926/255e07f0-f838-409c-8c86-2ef9afc25bff.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569303004/de524362-3865-4956-a554-55075eb7bed5.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569361676/0486b5c0-4532-43d7-bfd2-ec591ea79ad2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569392760/fb9bd598-d4d4-4b8b-ab33-82755cdf4349.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569461101/80bb12ad-3eec-4aef-a4e0-9e04cdfa2ffe.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569585390/89ede2d4-f93d-4f0d-8276-9a8845b13e33.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569758014/191bbdb5-abd8-414e-9008-6246316ee4b5.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569842401/16432d95-74b8-425b-90b0-d3a2130859d0.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569871338/8ed38ed1-2177-4d1f-a12c-f27d23f20181.png align="center")

```bash
cd pyapp/

ls

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 119261019513.dkr.ecr.us-east-1.amazonaws.com

docker build -t datacenter-ecr .

docker tag datacenter-ecr:latest 119261019513.dkr.ecr.us-east-1.amazonaws.com/datacenter-ecr:latest

docker images

docker push 119261019513.dkr.ecr.us-east-1.amazonaws.com/datacenter-ecr:latest
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569903925/b5660a67-fc99-400e-8dcb-95f8ebf87415.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766569923651/be221aa3-e9b3-4846-9296-001585bea3b5.png align="center")

Congratulations you did it. It looks good. This lab was successfully completed without any errors. See you in day 29. If you have any issues please let me know I will be happy to assist you. Stay tuned and learn together. If you find my article useful, please kindly like and share it.
