
ECRログイン
AWS_REGION=ap-northeast-1 REPOSITORY_NAME=example-repo
# aws ecr create-repository --profile {IAM User名} --repository-name ${REPOSITORY_NAME} --region ${AWS_REGION}
{
"repository": {
"repositoryUri": "xxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/example-repo",
"registryId": "xxxxx",
"imageTagMutability": "MUTABLE",
"repositoryArn": "arn:aws:ecr:ap-northeast-1:xxxxx:repository/example-repo",
"repositoryName": "example-repo",
"createdAt": 1652431907.0
}
}
REGISTRY_ID=xxxxx
REGISTRY_LOGIN_URL=${REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com
ログイン
AWS CLI v2バージョン
# aws ecr get-login-password --profile {IAM User名} --region ap-northeast-1 | docker login --username AWS --password-stdin ${REGISTRY_LOGIN_URL}
AWS CLI v1バージョン
# $(aws ecr get-login --profile {IAM User名} --region ${AWS_REGION} --no-include-email)
ECRへDockerイメージをPush
ビルド
% docker build -t ${REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${REPOSITORY_NAME}:latest .
ECRへプッシュ
% docker push ${REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${REPOSITORY_NAME}:latest


![[Solved] Git Pushでエラー | error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 send-pack: unexpected disconnect while reading sideband packet Writing objects: 100% (9/9), 2.30 MiB | 4.19 MiB/s, done. Total 9 (delta 5), reused 0 (delta 0), pack-reused 0 fatal: the remote end hung up unexpectedly](https://www.yuulinux.tokyo/contents/wp-content/uploads/2024/06/GitHub-Logo-1-e1718593223403-150x150.png)