3.2. Configuring container registries
You can display the container registries by using the podman info --format command:
$ podman info -f json | jq '.registries["search"]'
[
"registry.access.redhat.com",
"registry.redhat.io",
"docker.io"
]
The podman info command is available in Podman 4.0.0 or later.
You can edit the list of container registries in the registries.conf configuration file. As a root user, edit the /etc/containers/registries.conf file to change the default system-wide search settings.
As a user, create the $HOME/.config/containers/registries.conf file to override the system-wide settings.
unqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"]
short-name-mode = "enforcing"
By default, the podman pull and podman search commands search for container images from registries listed in the unqualified-search-registries list in the given order.
- Configuring a local container registry
You can configure a local container registry without the TLS verification. You have two options on how to disable TLS verification. First, you can use the
--tls-verify=falseoption in Podman. Second, you can setinsecure=truein theregistries.conffile:[[registry]] location="localhost:5000" insecure=true- Blocking a registry, namespace, or image
You can define registries the local system is not allowed to access. You can block a specific registry by setting
blocked=true.[[registry]] location = "registry.example.org" blocked = trueYou can also block a namespace by setting the prefix to
prefix="registry.example.org/namespace". For example, pulling the image by using thepodman pull registry. example.org/example/image:latestcommand will be blocked, because the specified prefix is matched.[[registry]] location = "registry.example.org" prefix="registry.example.org/namespace" blocked = true참고The
prefixis optional, default value is the same as thelocationvalue.You can block a specific image by setting
prefix="registry.example.org/namespace/image".[[registry]] location = "registry.example.org" prefix="registry.example.org/namespace/image" blocked = true- Mirroring registries
You can set a registry mirror in cases you cannot access the original registry. For example, you cannot connect to the internet, because you work in a highly-sensitive environment. You can specify multiple mirrors that are contacted in the specified order. For example, when you run
podman pull registry.example.com/myimage:latestcommand, themirror-1.comis tried first, thenmirror-2.com.[[registry]] location="registry.example.com" [[registry.mirror]] location="mirror-1.com" [[registry.mirror]] location="mirror-2.com"For more information, see the
podman-pull(1)andpodman-info(1)man pages on your system.