harbor: Adding new Registry Endpoint (docker-hub) results in `Failed to ping endpoint` error on Photon OS 3.0
Expected behavior and actual behavior: Adding Docker Hub as avnew Registry Endpoint should be successful when running Harbor on Photon OS 3.0.
Instead, Harbor throws an error: Failed to ping endpoint.
core.log:
Sep 23 16:58:07 172.18.0.1 core[308]: 2019-09-23T16:58:07Z [ERROR] [/replication/adapter/native/adapter.go:143]: failed to ping registry https://registry-1.docker.io: Head https://registry-1.docker.io/v2/: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 127.0.0.11:53: read udp 127.0.0.1:41081->127.0.0.11:53: i/o timeout
cURL does not work either in the harbor-core container:
$ docker exec -it harbor-core curl --head https://registry-1.docker.io/v2/
curl: (6) Could not resolve host: registry-1.docker.io
cURL works okay if using the harbor-core image without docker-compose:
$ docker run --rm -it --network harbor_harbor --entrypoint bash goharbor/harbor-core:v1.9.0
$ curl --head https://registry-1.docker.io/v2/
HTTP/1.1 401 Unauthorized
Content-Type: application/json
Docker-Distribution-Api-Version: registry/2.0
Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io"
Date: Mon, 23 Sep 2019 17:42:55 GMT
Content-Length: 87
Strict-Transport-Security: max-age=31536000
Steps to reproduce the problem:
- Install Photon OS 3.0 from OVA
tdnf install docker tar gawk
- Install docker-compose
- Install Harbor using the online installer from the releases page on GitHub
- Add a new Registry Endpoint using the docker-hub provider
- Error shows up in the GUI and in core.log
Versions:
- harbor version: 1.8.3 and 1.9.0
- docker engine version: 18.06.2-ce
- docker-compose version: 1.24.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 16 (7 by maintainers)
Had to do this on Ubuntu 20.10 Groovy. Without this Harbor wasn’t able to communicate with any online service for some reason.
As a workaround I’ve disabled the DNS stub listener (see
/etc/systemd/resolved.conf
):