on
Docker AWS SpringBoot ECR 배포하기
Docker AWS SpringBoot ECR 배포하기
반응형
Dockerfile
FROM amazoncorretto:11 ARG JAR_FILE=target/*.war COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","/app.jar"]
JAR_FILE 쪽에 사용하시는 부트 설정에 따라 war, jar를 바꿔주셔야합니다
pom.xml 위치에 있어야합니다
docker up docker build -t foo/bar . docker run -d -p 80:80 foo/bar
AWS-CLI 로그인
aws configure
권한 오류
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam:: is not authorized to perform: ecr:GetAuthorizationToken on resource: * Error: Cannot perform an interactive login from a non TTY device
aws 권한 부여
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ListImagesInRepository", "Effect": "Allow", "Action": [ "ecr:ListImages" ], "Resource": "arn:aws:ecr:ap-northeast-2:123456789000:repository/*" }, { "Sid": "GetAuthorizationToken", "Effect": "Allow", "Action": [ "ecr:GetAuthorizationToken" ], "Resource": "*" }, { "Sid": "ManageRepositoryContents", "Effect": "Allow", "Action": [ "ecr:GetAuthorizationToken", "ecr:BatchCheckLayerAvailability", "ecr:GetDownloadUrlForLayer", "ecr:GetRepositoryPolicy", "ecr:DescribeRepositories", "ecr:ListImages", "ecr:DescribeImages", "ecr:BatchGetImage", "ecr:InitiateLayerUpload", "ecr:UploadLayerPart", "ecr:CompleteLayerUpload", "ecr:PutImage" ], "Resource": "arn:aws:ecr:ap-northeast-2:123456789000:repository/*" } ] }
권한 오류 2
is not authorized to perform: ecr:InitiateLayerUpload on resource: arn:aws:ecr
두곳을 내 repository로 바꿔야함
from http://devel-lee.tistory.com/49 by ccl(A) rewrite - 2021-09-07 12:27:18