I have Container Registry enabled on my Gitlab installation, and when I navigate to a project, I am prompted to run docker login registry.gitlab.mydomain.com. Here is the output from running that command:
$ docker login registry.gitlab.mydomain.com/
Username: tgrosinger
Password:
Error response from daemon: Get https://registry.gitlab.mydomain.com/v2/: Get https://gitlab.mydomain.comjwt/auth?account=tgrosinger&client_id=docker&offline_token=true&service=container_registry: dial tcp: lookup gitlab.mydomain.comjwt on 192.168.0.1:53: no such host
When I curl this URL manually, but insert a “/” in between “mydomain.comjwt” I get a very different (and seemingly more functional) response.
Where is this request URL coming from and why is it missing a slash? I have tried adding a trailing slash to my configured registry_external_url in /etc/gitlab/gitlab.rb however that had no effect.
This seems to indicate that it knows about the correct domain that I am requesting. I am not sure where that missing slash is coming from.
Edit: Digging through the logs a little more, I can see that the request is making it through nginx on port 443 to the registry which is listening on localhost:5000. The registry is what outputs the log message above. I am not sure why from here it fails to connect to gitlab which is running locally.
I managed to get this working, but it required manually editing /var/opt/gitlab/registry/config.yml. Specifically, I needed to change the auth.token.realm to use https instead of http.
What setting do I need to modify in my /etc/gitlab/gitlab.rb to make this change unnecessary so it isn’t reverted next time I reconfigure?
Had a similar issue. Got auth.token.realm to configure correctly by setting the external_url to https in the gitlab.rb file. Take note this will require that you setup Gitlab for https using TLS certs and all that.