Docker-in-docker/GitLab CI: 자격 증명 도우미 추가 및 사용

Docker-in-docker/GitLab CI: 자격 증명 도우미 추가 및 사용

우리 조직에서는 프로젝트 중 하나를 위한 GitLab CI/CD 파이프라인을 구축하고 있습니다. 이 파이프라인의 한 작업은 자체 서버 중 하나에서 실행되는 Docker 실행기 GitLab 실행기에서 실행됩니다. 작업에는 docker:20.10.20서비스와 함께 이미지를 사용하는 작업이 포함됩니다 docker:20.10.20-dind. 목표는 프로젝트의 컨테이너 레지스트리에 업로드된 내 프로젝트에서 Docker 이미지를 빌드하는 것입니다.gitlab.com 자체에서 호스팅됨(Amazon ECR에서는 아님). 다음 작업 구성을 사용하여 이를 실행하고 있습니다 .gitlab-ci.yml.

docker-image-build:
  stage: Docker image build
  image: docker:20.10.20
  services:
    - name: docker:20.10.20-dind
      alias: docker
  tags:
    - docker-runner
  script:
    - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
    - docker build --pull -m 3g --memory-swap -1 -t $CI_REGISTRY_IMAGE --build-arg FOO=$FOO --build-arg BAR=$BAR .
    - docker push $CI_REGISTRY_IMAGE

그러나 docker login명령을 실행하면 script사이버 보안 관련 경고가 표시됩니다.

Login Succeeded
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

우리는 사이버 보안에 대해 매우 우려하고 있기 때문에 주변에 남아 있을 수 있는 인공물에 자격 증명을 암호화되지 않은 상태로 저장하는 것은 우리에게 큰 문제입니다. 그런데 설치방법을 못찾겠네요도커 자격 증명 도우미docker-in-docker 컨테이너에 있습니다. ( 충분한 엔트로피 소스와 함께 pass```` based credential helper.) It seems to be a very barebone Linux image without a package manager or compiler. It only has tools such as wget and tar, so I could be able to download binaries and I can in fact install thedocker-credential-pass binary itself. But I'm mostly stuck with no way to getpass gpg```를 사용하고 싶거나 사용해야 한다고 생각합니다 .installed, let alone its dependency

막혔는데 어떻게 진행해야 할지 모르겠습니다. 어떤 제안이라도 매우 감사하겠습니다. 이 경우 쉘 실행기로 전환해야 합니까?

미리 감사드립니다!
여호수아

관련 정보