3.2. 컨테이너 레지스트리 구성

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 구성 파일에서 컨테이너 레지스트리 목록을 편집할 수 있습니다. 루트 사용자로 /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 pullpodman 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
참고

prefix 는 선택 사항이며 기본값은 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"

추가 리소스