registries.conf

Podman에서 registries.conf 파일은 컨테이너 이미지 레지스트리를 구성하는 데 사용되는 중요한 설정 파일입니다. 이 파일은 Podman뿐만 아니라 Buildah, Skopeo와 같은 컨테이너 도구에서도 참조되며, 컨테이너 이미지를 가져오거나(push/pull) 검색할 때 사용할 레지스트리를 정의합니다.

registries.conf의 주요 역할

  1. 기본 레지스트리 설정
    • unqualified-search-registries 항목을 통해 이미지 이름이 정규화되지 않았을 때(예: nginx처럼 레지스트리 주소 없이 지정된 경우) 검색할 기본 레지스트리 목록을 정의합니다.
    • 예시:위 설정은 Podman이 이미지를 검색할 때 지정된 순서대로 레지스트리를 탐색하도록 합니다25.
      bash
      unqualified-search-registries = ["docker.io", "quay.io", "registry.fedoraproject.org"]
  2. 레지스트리 보안 설정
    • 특정 레지스트리에 대해 HTTPS를 강제하거나 비활성화(HTTP 허용)할 수 있습니다.
    • insecure=true로 설정하면 HTTPS 대신 HTTP를 사용하여 보안 검증 없이 통신합니다(주로 내부 네트워크에서 활용).
    • 예시:
    •  
      bash
      [[registry]] location = "myregistry.example.com" insecure = true
  3. 레지스트리 차단
    • 특정 레지스트리나 네임스페이스를 차단하여 Podman이 해당 경로에서 이미지를 가져오지 못하도록 설정할 수 있습니다.
    • 예시:
    •  
      bash
      [[registry]] location = "registry.example.org" blocked = true
  4. 레지스트리 별칭 및 짧은 이름 관리
    • 짧은 이름(예: nginx)에 대해 어떤 레지스트리를 사용할지 지정할 수 있습니다.
    • short-name-mode 옵션을 통해 짧은 이름 사용 시 경고를 표시하거나 특정 동작을 강제할 수 있습니다.
    • 예시:
    •  
      bash
      short-name-mode = "enforcing"
  5. 사용자별 설정 재정의
    • 시스템 전체 설정(/etc/containers/registries.conf) 외에도 사용자 홈 디렉토리(~/.config/containers/registries.conf)에 개인 설정을 추가하여 재정의할 수 있습니다510.

실제 사용 예시

  1. 기본 레지스트리 목록 추가
     
    bash
    unqualified-search-registries = ["docker.io", "quay.io", "localhost:5000"]
     
  2. 내부 네트워크용 HTTP 레지스트리 설정
     
    bash
    [[registry]] location = "localhost:5000" insecure = true
     
  3. 특정 네임스페이스 차단
     
    bash
    [[registry]] location = "registry.example.org" prefix = "registry.example.org/namespace" blocked = true
     

Podman에서 registries.conf 파일 위치

  • 시스템 전체 설정: /etc/containers/registries.conf
  • 사용자별 설정: $HOME/.config/containers/registries.conf

Podman과의 연동

  • Podman은 이미지를 가져오거나 검색할 때 이 파일을 참조합니다.
  • 변경 사항 적용 후 Podman 서비스를 재시작해야 할 수 있습니다:
     
    bash
    systemctl restart podman

결론적으로, registries.conf는 Podman 환경에서 이미지 검색, 보안, 네트워크 정책 등을 제어하는 핵심 구성 파일로, 다양한 환경(내부망, 외부망 등)에 맞게 유연하게 설정할 수 있습니다357.

Citations:

  1. https://andrewpage.tistory.com/267
  2. https://growupcoding.tistory.com/143
  3. https://wing-beat.tistory.com/126
  4. https://cyuu.tistory.com/175
  5. https://docs.redhat.com/ko/documentation/red_hat_enterprise_linux/9/html/building_running_and_managing_containers/con_configuring-container-registries_working-with-container-registries
  6. https://mc500.tistory.com/493
  7. https://docs.redhat.com/ko/documentation/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index
  8. https://blog.retrotv.dev/what-is-podman-and-install/
  9. https://velog.io/@wanny328/kubernetes-podman%EC%9D%84-%ED%86%B5%ED%95%9C-local-image-registry-%EA%B5%AC%EC%B6%95-%EB%B0%A9%EB%B2%95
  10. https://virtualtech.tistory.com/384
  11. https://blog.naver.com/pjt3591oo/222997069333
  12. https://anfrhrl5555.tistory.com/191
  13. https://waspro.tistory.com/679
  14. https://wing-beat.tistory.com/124

 

'클라우드 > K-PaaS' 카테고리의 다른 글

Redis  (0) 2025.04.14
Podman  (0) 2025.04.14
Kubectl  (0) 2025.04.14
Minikube  (0) 2025.04.14
K-Pass 실습환경  (0) 2025.04.14