Search code examples
podman

Unable to push to local, remapped registry using podman


Using podman 3.0.1, I have in /etc/containers/registries.conf.d/500-insecure-registries.conf (I'm not really using example.com; instead there is a real domain name in there):

[[registry]]
location = 'localhost:5000'
prefix = 'example.com'
insecure = true

I have an image that has been tagged as follows:

podman tag docker.io/library/hello-world example.com/hello-world

But when I try to push the image as follows (intending the localhost repository):

podman push example.com/hello-world

I receive an error that indicates it is actually trying to push to example.com as the location:

Error: error copying image to the remote destination: Error trying to reuse blob sha256:9c27e219663c25e0f28493790cc0b88bc973ba3b1686355f221c38a36978ac63 at destination: error pinging docker registry example.com: invalid status code from registry 404 (Not Found)

==================================

Based on what I read at https://www.redhat.com/sysadmin/manage-container-registries under "Remapping references", the push should go to the local registry... so does anyone have an idea what is wrong?

Thanks in advance!


Solution

  • I ran into the same problem, and found this issue. As explained in the comment:

    "Redirection and mirroring only happens when pulling, not when pushing or logging in."

    It's an expected behaviour. When you push the image, it should be tagged as localhost:5000/hello-world. Then you should be able to pull it as example.com/hello-world.