Trying to login to ECR fails with -no-include-email error

Above description is correct, steps are here:

  1. sudo apt install awscli
  2. sudo apt-get install python3-pip
  3. sudo pip3 install --upgrade awscli

Reference: https://github.com/aws/aws-cli/issues/2676


You might be using an older version of the CLI tools. Using a newer version of docker (17.09) and aws-cli (1.11.117 & 1.11.173) I don't receive this error

See the note here: http://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_AWSCLI.html#AWSCLI_get-login

http://docs.aws.amazon.com/cli/latest/reference/ecr/get-login.html

pip install --upgrade --user awscli

You may need to use pip3 or pip2 if you're using homebrew


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