I got stuck around the AWS CLI while updating a legacy environment, so I’m writing it down.
TL;DR
- The AWS CLI version was v1
- The Docker version was 17
From AWS CLI v1 to v2
The existing system was written like this.
aws ecr get-login --region ap-northeast-1
Upgrading the AWS CLI to v2 meant I had to change this now-deprecated syntax. (Apparently it’s deprecated in v1 now too.) https://dev.classmethod.jp/articles/aws-cli-v2-ecr-get-login-password/
aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin https://<AWS ACCOUNT ID>.dkr.ecr.ap-northeast-1.amazonaws.com
Here I ran into an unknown flag: --password-stdin error.
unknown flag: --password-stdin
As I dug in, I found that Docker was running on version 17. Updating Docker to the latest version fixed it.
Wrapping up
Legacy is rough.