📄

What Tripped Me Up When Logging into ECR with the AWS CLI

This article was automatically translated from theJapanese original by AI. It may contain translation errors.

This post was published over 2 years ago. Its content may be outdated.

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.

Recent Articles

Network(beta)

Drag to move / Ctrl+wheel to zoom