0
0

More than 1 year has passed since last update.

Docker 1.7環境下でのECRのプライベートリポジトリの利用方法

Last updated at Posted at 2021-10-24

Docker 1.11 以上なら
https://github.com/awslabs/amazon-ecr-credential-helper を使うことで、docker-login が 普通にECRに対しても認証できます。

今回の方法は、一旦 docker login したあとも、12時間経過したら再度 docker loginを叩かないといけません。
本当になんらかの理由でアップデートできない場合、というのが今回の内容です。

get-login-password を使った方法

aws-cliをv2にあげるのは簡単なのでとりあえずaws-cli2をあげておく
docker 1.7 だと -password-stdin というオプションは存在しないが、こんな感じでいける

docker login --username=AWS --password=`aws ecr get-login-password --profile profile`  --email=shida@example.com 0123456789.dkr.ecr.ap-northeast-1.amazonaws.com

あとは、通常通り docker push や pull できる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0