AWS Windows Powershell ECR Login

4.4k views Asked by At

I am new to AWS and Docker. I am trying to setup AWS ECR and docker and trying to retrieve ECR Login using windows powershell. I am trying to use the command -

Invoke-Expression -Command (aws ecr get-login) which gives me the errorenter image description here

My problem is it is trying to use the ccuser on its own. I don't think I have configured it to use this user. I have created a separate user with AmazonEC2ContainerRegistryFullAccess. How do I configure this as the user for AWS Powershell to execute the command?

2

There are 2 answers

0
VolatileRig On BEST ANSWER

aws ecr get-login will simply use the creds that you've already setup for the AWS CLI. If you want to change the creds for the CLI, use aws configure to do the setup again, it will ask you for:

AWS Access Key ID []: AWS Secret Access Key []: Default region name []: Default output format []:

If you only want to use that user temporarily without reconfiguring your existing account, here are the docs for doing that.

0
Kumar Pankaj Dubey On

simple and easy, I was debugging this for while but somehow it worked

aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin ecr.amazonaws.com