5장. 로컬 소스를 사용하여 컨테이너 실행 모범 사례
RHEL bootc 이미지를 실행할 때 사용자 정의 TLS(Transport Layer Security) 루트 인증서가 필요한 내부 레지스트리에서 호스팅되는 콘텐츠에 액세스할 수 있습니다.
로컬 리소스만 사용하여 컨테이너에 콘텐츠를 설치하는 데 사용할 수 있는 두 가지 옵션이 있습니다.
-
바인딩 마운트: 예를 들어
-v /etc/pki:/etc/pki
을 사용하여 컨테이너 저장소를 호스트의 저장소로 재정의합니다. -
파생 이미지:
Containerfile
을 사용하여 빌드하여 사용자 정의 인증서로 새 컨테이너 이미지를 생성합니다.
동일한 기술을 사용하여 bootc-image-builder
컨테이너 또는 적절한 경우 bootc
컨테이너를 실행할 수 있습니다.
5.1. 바인드 마운트를 사용하여 컨테이너로 사용자 정의 인증서 가져오기
바인딩된 마운트를 사용하여 컨테이너 저장소를 호스트의 저장소로 덮어씁니다.
프로세스
bootc-image-builder를 실행하고 바인딩 마운트(예:
-v /etc/pki:/etc/pki
)를 사용하여 컨테이너 저장소를 호스트의 저장소로 재정의합니다.podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v $(pwd)/output:/output \ -v /etc/pki:/etc/pki \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --type iso \ --config /config.toml \ quay.io/<namespace>/<image>:<tag>
# podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v $(pwd)/output:/output \ -v /etc/pki:/etc/pki \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --type iso \ --config /config.toml \ quay.io/<namespace>/<image>:<tag>
Copy to Clipboard Copied!
검증
- 이제 디스크 이미지 빌드 프로세스에서 내부 인증서에 액세스할 수 있어야 합니다.