3.2. 컨테이너 레지스트리 구성
Podman이 이미지를 검색하고 검색하는 방법을 제어하려면 RHEL에서 컨테이너 레지스트리를 구성할 수 있습니다. 신뢰할 수 있는 소스 및 검색 우선 순위를 정의하면 인프라 전체에서 예측 가능한 애플리케이션 배포가 가능합니다.
podman info --format 명령을 사용하여 컨테이너 레지스트리를 표시할 수 있습니다.
$ podman info -f json | jq '.registries["search"]'
[
"registry.access.redhat.com",
"registry.redhat.io",
"docker.io"
]
podman info 명령은 Podman 4.0.0 이상에서 사용할 수 있습니다.
registries.conf 구성 파일에서 컨테이너 레지스트리 목록을 편집할 수 있습니다. root 사용자로 /etc/containers/registries.conf 파일을 편집하여 기본 시스템 전체 검색 설정을 변경합니다. 사용자로 $HOME/.config/containers/registries.conf 파일을 생성하여 시스템 전체 설정을 재정의합니다.
unqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"]
short-name-mode = "enforcing"
기본적으로 podman pull 및 podman search 명령은 지정된 순서로 unqualified-search-registries 목록에 나열된 레지스트리에서 컨테이너 이미지를 검색합니다.
- 로컬 컨테이너 레지스트리 구성
TLS 확인 없이 로컬 컨테이너 레지스트리를 구성할 수 있습니다. TLS 확인을 비활성화하는 두 가지 옵션이 있습니다. 먼저 Podman에서
--tls-verify=false옵션을 사용할 수 있습니다. 두 번째는registries.conf파일에서insecure=true를 설정할 수 있습니다.[[registry]] location="localhost:5000" insecure=true- 레지스트리, 네임스페이스 또는 이미지 차단
로컬 시스템이 액세스할 수 없는 레지스트리를 정의할 수 있습니다.
blocked=true를 설정하여 특정 레지스트리를 차단할 수 있습니다.[[registry]] location = "registry.example.org" blocked = true접두사를
prefix="registry.example.org/ <namespace> " 로 설정하여네임스페이스를차단할 수도 있습니다. 예를 들어, 지정된 접두사가 일치하므로podman pull registry. example.org/example/image:latest명령을 사용하여 이미지를 가져오는 것이 차단됩니다.[[registry]] location = "registry.example.org" prefix="registry.example.org/_<namespace>_" blocked = true참고접두사는 선택 사항이며 기본값은location값과 동일합니다.prefix="registry.example.org/namespace/image"를 설정하여 특정 이미지를 차단할 수 있습니다.[[registry]] location = "registry.example.org" prefix="registry.example.org/_<namespace>_/image" blocked = true- 레지스트리 미러링
원래 레지스트리에 액세스할 수 없는 경우 레지스트리 미러를 설정할 수 있습니다. 예를 들어 매우 민감한 환경에서 작업하므로 인터넷에 연결할 수 없습니다. 지정된 순서로 연결된 여러 미러를 지정할 수 있습니다. 예를 들어
podman pull registry.example.com/myimage:latest명령을 실행하면mirror-1.com이 먼저 시도된 다음mirror-2.com.[[registry]] location="registry.example.com" [[registry.mirror]] location="mirror-1.com" [[registry.mirror]] location="mirror-2.com"자세한 내용은 시스템의
podman-pull(1)및podman-info(1)도움말 페이지를 참조하십시오.