---
# System prepended metadata

title: ECR
tags: [aws]

---

- ECR에 로그인도 다 했는데 docker image push가 안될 경우
ECR 좌측 메뉴 permission 진입 -> JSON 편집
    ```json
    {
      "Version": "2008-10-17",
      "Statement": [
        {
          "Sid": "Statement1",
          "Effect": "Allow",
          "Principal": {
            "AWS": "*"
          },
          "Action": [
            "ecr:BatchCheckLayerAvailability",
            "ecr:BatchGetImage",
            "ecr:CompleteLayerUpload",
            "ecr:GetDownloadUrlForLayer",
            "ecr:InitiateLayerUpload",
            "ecr:PutImage",
            "ecr:UploadLayerPart"
          ]
        }
      ]
    }
    ```
    
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 171887453079.dkr.ecr.us-east-1.amazonaws.com

docker build -t megatron-lm .

docker tag megatron-lm:latest 171887453079.dkr.ecr.us-east-1.amazonaws.com/megatron-lm:latest

docker push 171887453079.dkr.ecr.us-east-1.amazonaws.com/megatron-lm:latest