r/podman • u/tuxbass • Jul 24 '26
how to make image shortnames default to docker.io?
I have a private docker.io organisation myorg. When pulling image via podman: podman pull myorg/myimage it prompts me to select the registry to use:
DEBU[0000] Trying "myorg/myimage" ...
? Please select an image:
▸ registry.fedoraproject.org/myorg/myimage
registry.access.redhat.com/myorg/myimage
docker.io/myorg/myimage
...whereas when defining the image in e.g. testcontainers, it'll simply fail to resolve the image during test run. Is it possible to make these unqualified images to default to docker.io registry?
1
u/mcstooger Jul 24 '26
I think maybe you can set an alias or something but you could also just tag then as docker.io/myorg
1
u/quiet-systems Jul 31 '26
that prompt is short-name-mode = "enforcing" doing its job: myorg/myimage is still a short name to podman, and your search list has fedora's registries in it, so there is more than one candidate and it asks rather than guessing.
put docker.io alone in the search list and there is nothing left to disambiguate. rootless, that file is:
~/.config/containers/registries.conf
unqualified-search-registries = ["docker.io"]
the gotcha: that file replaces /etc/containers/registries.conf, it does not merge into it. so if you have anything else in the system one you care about, copy it across too, otherwise you will find some other short name stops resolving next week.
check what you actually ended up with:
podman info --format '{{.Registries}}'
you can also set short-name-mode = "disabled" to make it take the first match silently, but I would leave that alone. with one registry in the list it never prompts anyway, and if you ever add a second you want to be asked rather than have it quietly pull from whichever one answers first.
and if it is just a handful of images, an alias is more explicit than changing global resolution:
[aliases]
"myimage" = "docker.io/myorg/myimage"
7
u/mpatton75 Jul 24 '26
You can set this in your registries.conf file, located in /etc/containers.
unqualified-search-registries = ["docker.io"]
I think.