linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20201001] get-login-passwordを使おう #12

Open linzhengen opened 3 years ago

linzhengen commented 3 years ago

aws cli ver2以上だと、aws ecr get-loginは使えなくなるので、get-login-passwordを使おう

Makefile diff

docker-login:
-       $(aws ecr get-login --region ap-northeast-1 --no-include-email)
+       $(eval accountId=$(shell aws sts get-caller-identity --query 'Account' --output text))
+       aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin $(accountId).dkr.ecr.ap-northeast-1.amazonaws.com