Docker-Registrierung auf localhost funktioniert nicht

Docker-Registrierung auf localhost funktioniert nicht

Ich verwende auf dem Host ein privates Docker-Register foomit Folgendem docker-compose.yml:

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

Ich habe beim Host foodie Datei hinzugefügt/etc/docker/daemon.json

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

Und docker infozeigt:

Insecure Registries:
  localhost:5000
  127.0.0.0/8

(Ich habe wirklich keine Ahnung, woher der zweite Eintrag stammt.)

Aber der Anruf docker pull localhost:5000/myappfunktioniert nicht. Es passiert einfach nichts und es kommt nie etwas zurück. Dasselbe, wenn ich anrufe 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: */*
>

Mit meinem VPN (OpenVPN) kann ich auf das private Docker-Repository auf diesem Host zugreifen und die App pushen (oder etwas anderes tun).

(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

Ein Firewall-Problem kann ich ausschließen. Irgendwelche Ideen? Danke!

PS: Vor einigen Wochen hat das noch einwandfrei funktioniert und ich habe keine Ahnung, was sich geändert hat ... :(

Antwort1

Es ist kein Docker-, sondern ein Firewall-Problem.

verwandte Informationen