7.10.2. 개인 레지스트리에 액세스하도록 bootc 구성
프라이빗 레지스트리에서 컨테이너 이미지를 가져오려면 bootc 워크플로우에 유효한 인증 자격 증명을 제공해야 합니다. 컨테이너 이미지에 포함된 일반적인 영구 파일에 bootc 및 Podman 인증 정보 경로를 심볼릭하면 환경 전체에서 시크릿을 가져오기 위해 단일 정보 소스를 유지 관리할 수 있습니다.
사전 요구 사항
-
Bootc는 레지스트리에 대한 개인 액세스를 제공합니다.
프로세스
/usr/lib/container-auth.json레지스트리 인증 파일을 생성하고 다음 콘텐츠를 추가합니다.# Make /run/containers/0/auth.json (a transient runtime file) # a symlink to our /usr/lib/container-auth.json (a persistent file) # which is also symlinked from /etc/ostree/auth.json. d /run/containers/0 0755 root root - L /run/user/0/containers/auth.json - - - - ../../../../usr/lib/container-auth.json동일한 디렉터리에 Containerfile을 생성합니다. 예를 들면 다음과 같습니다.
# This example expects a secret named "creds" to contain # the registry pull secret. To build, for example # podman build --secret id=creds,src=$HOME/.docker/config.json ... FROM quay.io/<namespace>/<image>:_<tag>_ # Use a single pull secret for bootc and podman by symlinking both locations # to a common persistent file embedded in the container image. # We just make up /usr/lib/container-auth.json COPY containers-auth.conf /usr/lib/tmpfiles.d/link-podman-credentials.conf RUN --mount=type=secret,id=creds,required=true cp /run/secrets/creds /usr/lib/container-auth.json && \ chmod 0600 /usr/lib/container-auth.json && \ ln -sr /usr/lib/container-auth.json /etc/ostree/auth.json이러한 설정을 포함하면 특정 커널 옵션을 컨테이너 이미지에서 프로비저닝된 모든 시스템에 일관되게 적용할 수 있으므로 배포 후 구성이 필요하지 않습니다.
-
container-auth.json파일을/etc/ostree/auth.json에 배치하여 프라이빗 레지스트리 인증을 구성합니다.