Docker silently turns nginx into docker.io/library/nginx. Podman does not: without an alias and without a search list in registries.conf, a short name only matches images already stored locally. On a fresh CI runner the build fails.
Symptom
podman build -t localhost/r15-doku:1 .; echo "Exit: $?" STEP 1/2: FROM nginx:stable-alpine Error: creating build container: short-name "nginx:stable-alpine" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf" Exit: 125
“It works for me with Docker” – the Containerfile uses FROM nginx:stable-alpine.
Diagnosis
No search list, no alias – and only the locally stored image matches a short name.
grep -n 'unqualified-search-registries' /etc/containers/registries.conf
grep -c '"nginx"' /etc/containers/registries.conf.d/shortnames.conf
podman images --format '{{.Repository}}:{{.Tag}}' | grep nginx
21:# unqualified-search-registries = ["example.com"]
0
docker.io/library/nginx:1.30.6-alpine
Causes
short namePodman does not search Docker Hub automatically
Without unqualified-search-registries and without an alias in shortnames.conf Podman does not know which registry the name belongs to – on purpose, against name squatting.
local matchWorks for you, not in CI
A short name matches an image that is already stored locally. That is why nginx:1.30.6-alpine works on your machine but not on a fresh runner.
stable-alpineMoving tag
stable-alpine points to a different image tomorrow. A fixed tag makes the build reproducible.
Fix
sed -i 's#^FROM nginx:stable-alpine#FROM docker.io/library/nginx:1.30.6-alpine#' \ Containerfile podman build -q -t localhost/r15-doku:1 . | cut -c1-12 d2e47fdc45a1
Don't: Add a search list with several registries just to make short names work again – then the order decides where an image comes from.
Container tools hands-on, Day 16: repair ten broken container setups with Podman, Quadlet, crane, skopeo and cosign.
Go to day 16 →
FAQ
What is in shortnames.conf?
Aliases for well-known short names, e.g. fedora → registry.fedoraproject.org/fedora. There is no entry for nginx.
How do I write a Docker Hub image fully qualified?
Official images live under docker.io/library/<name>:<tag>, others under docker.io/<user>/<name>:<tag>.