Red Hat Training
A Red Hat training course is available for RHEL 8
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
設定ファイルでコンテナーレジストリーのリストを編集できます。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 = "permissive"
デフォルトでは、podman pull
および podman search
コマンドは、unqualified-search-registries
のリストに記載のレジストリーから、その順序でコンテナーイメージを検索します。
- ローカルコンテナーレジストリーの設定
TLS 検証なしでローカルコンテナーレジストリーを設定できます。TLS 検証を無効にする方法は 2 つあります。まず、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"
関連情報
- How to manage Linux container registries
-
podman-pull
の man ページ -
podman-info
の man ページ