![경로에 amazon-ecr-credential-helper를 추가하는 방법](https://rvso.com/image/717749/%EA%B2%BD%EB%A1%9C%EC%97%90%20amazon-ecr-credential-helper%EB%A5%BC%20%EC%B6%94%EA%B0%80%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
설정하려고 하는데Amazon-ecr-자격 증명-헬퍼ansible 스크립트가 aws ecr docker 저장소에 자동으로 push/pull되도록 할 수 있지만 설치 지침이 매우 모호해 보입니다.
Docker가 이미 설치되어 있으므로 repo를 복제하고 make docker
. 바이너리를 "로컬 디렉터리로" 출력한다고 합니다. 그것이 사실인 것처럼 보였고 결국 나는 ./bin/local/docker-credential-ecr-login
만들어졌습니다. 그래서 나는 그것을 내 경로에 추가하려고 시도했습니다.
.bash_profile
export PATH="$HOME/anaconda3/bin:$HOME/projects/amazon-ecr-credential-helper/bin:$PATH"
터미널을 다시 시작했지만 docker push를 시도하면 오류가 발생합니다 no basic auth credentials
.
그리고 내가 하려고 하면 docker-compose build
오류가 발생합니다 Credentials store error: StoreError('docker-credential-ecr-login not installed or not available in PATH',)
.
답변1
Ubuntu에서 자격 증명 도우미를 설정하는 단계입니다.
이는 docker가 설치되어 있고 ~/.aws/credentials 파일에서 AWS 자격 증명을 사용할 수 있다고 가정합니다.
- Git 저장소 복제https://github.com/awslabs/amazon-ecr-credential-helper.git
- 복제된 폴더 "amazon-ecr-credential-helper"로 CD를 이동합니다.
- "make docker" 터미널에서 명령을 실행하세요.
- 바이너리 "./bin/local/docker-credential-ecr-login"을 생성합니다.
- " sudo cp ./bin/local/docker-credential-ecr-login /usr/bin/lib/docker-credential-ecr-login 명령을 사용하여 이 바이너리를 /usr/bin/lib에 복사합니다.
아래 내용으로 /.docker/config.json에서 사용 가능한 docker config.json 파일을 생성하거나 수정합니다.
{ "credsStore": "ecr-login" }
그런 다음 도커 이미지를 AWS ECR 리포지토리로 푸시해 보세요.
Ravneet Arora(DevOps)