I faced the following issue while trying to pull docker image present in the docker hub in podman using the following command.
docker pull nginx:stable
The error I received was
Error: short-name "nginx:stable" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"
Initially I assumed something was broken, but it’s not.
This error is actually a deliberate security feature and understanding it will make you better at working with containers.
We have two ways to solve this.
Option 1: Use fully qualified name of the image including the registry name.
The solution is to use fully qualified name instead of short name. That means instead of using “nginx:stable”, we need to make it as “docker.io/nginx:stable”.
docker pull docker.io/nginx:stable
Option 2: Add external registries to the podman configuration
Edit the following config file and make an entry into the unqualified-search-registries = []
/etc/containers/registries.conf
Add the following entry into the file.
unqualified-search-registries = ["docker.io"]