Saturday, September 3, 2022

[SOLVED] AWS ECR Login with podman

Issue

Good morning/afternoon/night! Can you help me, please?

I'm working with RHEL 8.2 and this version doesn't support Docker. I installled Podman and everything was ok until I use the following command:

$(aws ecr get-login --no-include-email --region us-east-1)

But, it doesn't work because it's from Docker (I thought it was from AWS Cli).

The error is:

# $(aws ecr get-login --no-include-email --region us-east-1)
-bash: docker: command not found

I've been searching for an answer and some people used a command like this:

podman login -u AWS -p ....

But I tried some flags and the image, but nothing is working!

What is the equivalent command for podman?

Thanks!


Solution

The above command is not associated to docker alone.

It is an AWS cli command to authenticate into the private container image registry(ECR).

Run the below command to get the password for container registry

aws ecr get-login-password --region us-east-1

Then use the password against the below command

podman login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com


Answered By - Prashanna
Answer Checked By - Marie Seifert (WPSolving Admin)