Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
43
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

@Jey

Amazon ECR使い方簡易版

追記

東京リージョンリリースされたので、追記
s/us-east-1/ap-northeast-1/g

リポジトリ作成

リポジトリ作るAPI調べる前に手で作っちゃった。下記ページでとりあえず、create repositryしちゃう。
https://console.aws.amazon.com/ecs/home?region=ap-northeast-1#/repositories

IAMで権限設定

IAMで権限降ってね AmazonEC2ContainerRegistryFullAccess

awscliをアップデート

% pip install --upgrade awscli

docker-login

docker-pushの時にログインを促されるから事前にやっとく

% $(aws ecr get-login --region ap-northeast-1)

configファイルをからリポジトリ確認しましょう。

% cat ~/.docker/config.json
{
        "auths": {
                "https://1234567890.dkr.ecr.ap-northeast-1.amazonaws.com": {   <= これな!

あとはdocker-build & push!

# ECR_REPOSしっかり確認
export ECR_REPOS=1234567890.dkr.ecr.ap-northeast-1.amazonaws.com
export REPOS_NAME=my-app:latest
docker build -t $ECR_REPOS/$REPOS_NAME .
docker push $ECR_REPOS/$REPOS_NAME

メモ

こういうのが出たら、認証キーの有効期限が切れてるかも。

Error pushing to registry: Server error: unexpected 403 response status trying to initiate upload of ur-app

もっかいログインすればOK

$(aws ecr get-login --region ap-northeast-1)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
43
Help us understand the problem. What are the problem?