AWS
AWS Container Registry
1. Create a repository
- Login into AWS Console
- Navigate to Amazon Container Services
- Navigate to Repositories
- Click create repository

- Fill the required details

- Click Create Repository
- The repository is created

2. Getting the Push Commands
- Navigate to the newly created repository

- Click “View Push Commands”
- You can see the commands

3. Login Docker Client
Make sure the user has permissions to “ecr:GetAuthorizationToken”. Otherwise you will get the below error –
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::526470662813:user/AWSDba is not authorized to perform: ecr:GetAuthorizationToken on resource: *
- Get the token
Copy past the login command.
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com
% aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com
Login Succeeded
4. Build the image and publish
For this example, we will use this repository – docker-library/python: Docker Official Image packaging for Python (github.com).
Clone the repository and build the docker image.
docker build -f 3.9/buster/slim/Dockerfile -t python:3-8-slim .
Tag the image.
docker tag python:3-8-slim xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/python:3-8-slim
Publish the image.
docker push xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/python:3-8-slim
% docker push xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/python:3-8-slim
The push refers to xxxxxxxxx [526470662813.dkr.ecr.us-east-1.amazonaws.com/python]
a18688d0f743: Pushed
92a2f04a63cd: Pushed
e02f907200b6: Pushed
5d8b6ff688d4: Pushed
02c055ef67f5: Pushed
3-8-slim: digest: sha256:3ba273f0f891afb882bb5ec060542a794d53eb82bb8d62a7ad0caee60dc2630f size: 1370
%
Now you can see the image in the ECR.

-
AWS3 years ago
How to install NodeJS in Amazon Linux 2
-
Infrastructure3 years ago
How to test CPU, Memory and File System Performance using Sysbench
-
AWS3 years ago
How to install .Net 6 in Amazon Linux 2
-
Uncategorized3 years ago
How to install Docker in Amazon Linux 2?
-
Infrastructure3 years ago
How to get Linux OS Information using uname command
-
Infrastructure3 years ago
How to reproduce CVE-2021-44228 (Log4J vulnerability), patch it, and validate the fix
-
Uncategorized3 years ago
Everything, Everywhere, All At Once
-
Linux3 years ago
How to install git in Amazon Linux 2