0

I am encountering a problem with Podman on my system when I try to push images to a local registry. First, I start the registry container with sudo.

$ sudo podman container run -dt -p 5000:5000 --name registry docker.io/library/registry:2 

I can check the logs :

$ sudo podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES <id> docker.io/library/registry:2 /etc/docker/regis... 26 minutes ago Up 26 minutes ago 0.0.0.0:5000->5000/tcp registry $ sudo podman logs registry WARN[0000] No HTTP secret provided - generated random secret. This may cause problems with uploads if multiple registries are behind a load-balancer. To provide a shared secret, fill in http.secret in the configuration file or set the REGISTRY_HTTP_SECRET environment variable. go.version=go1.20.8 instance.id=id service=registry version=2.8.3 INFO[0000] redis not configured go.version=go1.20.8 instance.id=<id>service=registry version=2.8.3 INFO[0000] using inmemory blob descriptor cache go.version=go1.20.8 instance.id=<id> service=registry version=2.8.3 INFO[0000] Starting upload purge in 31m0s go.version=go1.20.8 instance.id=<id> service=registry version=2.8.3 INFO[0000] listening on [::]:5000 go.version=go1.20.8 instance.id=<id> service=registry version=2.8.3 

Then, I get this error when I try to push my image :

$ sudo podman push localhost:5000/my-image --tls-verify=false Getting image source signatures WARN[0012] failed, retrying in 1s ... (1/3). Error: trying to reuse blob sha256:<sha256>at destination: pinging container registry localhost:5000: Get "http://localhost:5000/v2/": dial tcp 127.0.0.1:5000: connect: no route to host Getting image source signatures WARN[0026] failed, retrying in 1s ... (2/3). Error: trying to reuse blob sha256:<sha> at destination: pinging container registry localhost:5000: Get "http://localhost:5000/v2/": dial tcp 127.0.0.1:5000: connect: no route to host Getting image source signatures WARN[0038] failed, retrying in 1s ... (3/3). Error: trying to reuse blob sha256:<sha> at destination: pinging container registry localhost:5000: Get "http://localhost:5000/v2/": dial tcp 127.0.0.1:5000: connect: no route to host Getting image source signatures Error: trying to reuse blob sha256:<sha> at destination: pinging container registry localhost:5000: Get "http://localhost:5000/v2/": dial tcp 127.0.0.1:5000: connect: no route to host 

However, if I do the same without sudo, it is working correctly.

I also tried to do it with sudo -E but I got the same error.

Any ideas ?

1 Answer 1

0

I found a solution :

sudo podman run -d --network=host --name registry registry:2 

use of --network=host fixed this issue.

This may not be the best method in terms of security.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.