0

I am using a private docker registry on the host foo with the following docker-compose.yml:

version: '3.2'
services:
  registry:
    restart: unless-stopped
    image: registry:2
    ports:
    - 5000:5000
    volumes:
    - /tmp/myregistry:/var/lib/registry

I added at the host foo the file /etc/docker/daemon.json

{
    "insecure-registries" : [ "localhost:5000" ]
}

And docker info shows:

Insecure Registries:
  localhost:5000
  127.0.0.0/8

(I really have no idea, where the second entry is from.)

But calling docker pull localhost:5000/myapp does not work. It simply does nothing and never returns. The same, when I call curl -kv http://localhost:5000/v2/ ...

(root@foo)/etc/docker# curl -kv http://localhost:5000/v2/
*   Trying 127.0.0.1:5000...
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /v2/ HTTP/1.1
> Host: localhost:5000
> User-Agent: curl/7.74.0
> Accept: */*
>

Using my vpn (openvpn), I can access the private docker-repository on this host and push the app (or do anything else).

(thomas@otherhost)~# curl -i http://foo:5000/v2/
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Tue, 14 Jun 2022 22:02:04 GMT

I can exclude a firewall problem. Any ideas? TIA!

PS: Some weeks ago, this works fine, and I have no idea, what has changed ... :(

t777
  • 211
  • 1
  • 8
  • The second entry is there by default, and it already covers localhost, so your own entry is superfluous. Check out the log files of your registry. – Gerald Schneider Jun 15 '22 at 09:46
  • I found it. The logs of my registry does not show any error/warning, nothing about trying to connect. – t777 Jun 15 '22 at 11:36
  • Well, I can't reproduce your issue. I started a registry using your docker-compose.yml, pushed an image to it and was able to pull it. It doesn't matter if I add the registry to the insecure registries or not. – Gerald Schneider Jun 15 '22 at 11:41
  • Which OS are you using? (I have Debian bullseye) – t777 Jun 15 '22 at 11:49
  • Using a brand new installed ubuntu 22.04-LTS it works for me to :( – t777 Jun 15 '22 at 12:06
  • It is a firewall reason. If I disable whole firewall, it works. I do not understand it, but I have to check it. – t777 Jun 15 '22 at 12:13

1 Answers1

0

It is not a docker, but a firewall problem.

t777
  • 211
  • 1
  • 8