경로에 amazon-ecr-credential-helper를 추가하는 방법

경로에 amazon-ecr-credential-helper를 추가하는 방법

설정하려고 하는데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 자격 증명을 사용할 수 있다고 가정합니다.

  1. Git 저장소 복제https://github.com/awslabs/amazon-ecr-credential-helper.git
  2. 복제된 폴더 "amazon-ecr-credential-helper"로 CD를 이동합니다.
  3. "make docker" 터미널에서 명령을 실행하세요.
  4. 바이너리 "./bin/local/docker-credential-ecr-login"을 생성합니다.
  5. " sudo cp ./bin/local/docker-credential-ecr-login /usr/bin/lib/docker-credential-ecr-login 명령을 사용하여 이 바이너리를 /usr/bin/lib에 복사합니다.
  6. 아래 내용으로 /.docker/config.json에서 사용 가능한 docker config.json 파일을 생성하거나 수정합니다.

      {
          "credsStore": "ecr-login"
       }
    

    그런 다음 도커 이미지를 AWS ECR 리포지토리로 푸시해 보세요.

Ravneet Arora(DevOps)

관련 정보