AWS ecr get-login generates docker login command with an unknown flag

1.1k Views Asked by At

when I generate the docker login command to my AWS ECR with the following command:

aws ecr get-login  --region us-east-2

I get an output like:

docker login -u AWS -p [bigbass] -e none https://xxxx.dkr.ecr.us-east-2.amazonaws.com

The problem is the -e flag that throws an error:

unknown shorthand flag: 'e' in -e
See 'docker login --help'.

I first thought that the problem was a mis configured aws configure, as I was using none as "Default output format" option. After that I fixed the format option inside aws configure but it still happens.

1

There are 1 best solutions below

0
On BEST ANSWER

They not so long ago changed their CLI. It looks like this now:

get-login [--registry-ids <value> [<value>...]] [--include-email | --no-include-email]

So simply replace -e none with --no-include-email.

See the corresponding documentation here.