본문 바로가기

퍼블릭 클라우드

[AWS] Amazon ECR(Amazon Elastic Container Registry) 구성

728x90

Amazon ECR(Amazon Elastic Container Registry) 구성

퍼블릭 리포지토리 생성

eksadmin 인스턴스 작업

인증 명령

$ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/xxxxxxxx
WARNING! Your password will be stored unencrypted in /home/ec2-user/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

이미지 태그 변경 명령

$ docker tag web-site:v1.0 public.ecr.aws/xxxxxxxx/web-site:v1.0

푸시 명령

$ docker push public.ecr.aws/xxxxxxxx/web-site:v1.0
The push refers to repository [public.ecr.aws/xxxxxxxx/web-site]
52bbe144bd1d: Pushed 
09115a3b9efd: Pushed 
e6858c54c2be: Pushed 
9f54eef41275: Pushed 
v1.0: digest: sha256:6075f80a4599363f781500f428e43589f71a9ad8d901a306616d377da7064a1a size: 1158

리포지토리에 올라간 이미지

Linux에서 AWS CLI 버전 2 설치

 - https://docs.aws.amazon.com/ko_kr/cli/latest/userguide/install-cliv2-linux.html

$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

$ unzip awscliv2.zip

$ sudo ./aws/install

$ aws --version
aws-cli/2.3.2 Python/3.8.8 Linux/4.14.246-187.474.amzn2.x86_64 exe/x86_64.amzn.2 prompt/off

aws cli 버전 2에서 ecr 명령을 사용할 수 있다.

728x90