I am using this command to login to docker on my EC2
$(aws ecr get-login --registry-ids xxxxxxx --region us-west-1 --no-include-email)
when I do that, I get following error:
Unknown options: --no-include-email
what am I missing?
To authenticate Docker to an Amazon ECR registry with get-login-password, run the aws ecr get-login-password command. When passing the authentication token to the docker login command, use the value AWS for the username and specify the Amazon ECR registry URI you want to authenticate to.
The URL for your default private registry is https:// aws_account_id . dkr. ecr.
An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.
Above description is correct, steps are here:
sudo apt install awscli
sudo apt-get install python3-pip
sudo pip3 install --upgrade awscli
Reference: https://github.com/aws/aws-cli/issues/2676
The answer is already given, but it does not work aws-cli v2, so posting as an answer may help other
$(aws ecr get-login --no-include-email --region us-west-2)
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
To get login token with aws-cli V2 you can try
aws ecr get-login-password | docker login --username AWS --password-stdin 1234567890.dkr.ecr.us-west-2.amazonaws.com/reponame
To install AWS-CLI V2 you can check here
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With