Podman에서 registries.conf 파일은 컨테이너 이미지 레지스트리를 구성하는 데 사용되는 중요한 설정 파일입니다. 이 파일은 Podman뿐만 아니라 Buildah, Skopeo와 같은 컨테이너 도구에서도 참조되며, 컨테이너 이미지를 가져오거나(push/pull) 검색할 때 사용할 레지스트리를 정의합니다.
registries.conf의 주요 역할
- 기본 레지스트리 설정
- 레지스트리 보안 설정
- 특정 레지스트리에 대해 HTTPS를 강제하거나 비활성화(HTTP 허용)할 수 있습니다.
- insecure=true로 설정하면 HTTPS 대신 HTTP를 사용하여 보안 검증 없이 통신합니다(주로 내부 네트워크에서 활용).
- 예시:
-
bash[[registry]] location = "myregistry.example.com" insecure = true
- 레지스트리 차단
- 특정 레지스트리나 네임스페이스를 차단하여 Podman이 해당 경로에서 이미지를 가져오지 못하도록 설정할 수 있습니다.
- 예시:
-
bash[[registry]] location = "registry.example.org" blocked = true
- 레지스트리 별칭 및 짧은 이름 관리
- 짧은 이름(예: nginx)에 대해 어떤 레지스트리를 사용할지 지정할 수 있습니다.
- short-name-mode 옵션을 통해 짧은 이름 사용 시 경고를 표시하거나 특정 동작을 강제할 수 있습니다.
- 예시:
-
bashshort-name-mode = "enforcing"
- 사용자별 설정 재정의
실제 사용 예시
- 기본 레지스트리 목록 추가
bashunqualified-search-registries = ["docker.io", "quay.io", "localhost:5000"]
- 내부 네트워크용 HTTP 레지스트리 설정
bash[[registry]] location = "localhost:5000" insecure = true
- 특정 네임스페이스 차단
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 서비스를 재시작해야 할 수 있습니다:
bashsystemctl restart podman
결론적으로, registries.conf는 Podman 환경에서 이미지 검색, 보안, 네트워크 정책 등을 제어하는 핵심 구성 파일로, 다양한 환경(내부망, 외부망 등)에 맞게 유연하게 설정할 수 있습니다357.
Citations:
- https://andrewpage.tistory.com/267
- https://growupcoding.tistory.com/143
- https://wing-beat.tistory.com/126
- https://cyuu.tistory.com/175
- 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
- https://mc500.tistory.com/493
- https://docs.redhat.com/ko/documentation/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index
- https://blog.retrotv.dev/what-is-podman-and-install/
- 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
- https://virtualtech.tistory.com/384
- https://blog.naver.com/pjt3591oo/222997069333
- https://anfrhrl5555.tistory.com/191
- https://waspro.tistory.com/679
- https://wing-beat.tistory.com/124